]>
git.proxmox.com Git - cargo.git/blob - vendor/openssl-0.9.19/src/memcmp.rs
4 /// Returns `true` iff `a` and `b` contain the same bytes.
6 /// This operation takes an amount of time dependent on the length of the two
7 /// arrays given, but is independent of the contents of a and b.
11 /// This function will panic the current task if `a` and `b` do not have the same
13 pub fn eq(a
: &[u8], b
: &[u8]) -> bool
{
14 assert
!(a
.len() == b
.len());
17 a
.as_ptr() as *const _
,
18 b
.as_ptr() as *const _
,
31 assert
!(eq(&[], &[]));
32 assert
!(eq(&[1], &[1]));
33 assert
!(!eq(&[1, 2, 3], &[1, 2, 4]));