]> git.proxmox.com Git - cargo.git/blobdiff - vendor/openssl/src/memcmp.rs
New upstream version 0.63.1
[cargo.git] / vendor / openssl / src / memcmp.rs
index 3b7bf3b28bcdd8d199baa1616f00322ac307264f..91281b9af304b9be6dbddfcfe498ea3c969b65e5 100644 (file)
@@ -12,7 +12,7 @@
 //!
 //! # Examples
 //!
-//! To perform a constant-time comparision of two arrays of the same length but different
+//! To perform a constant-time comparison of two arrays of the same length but different
 //! values:
 //!
 //! ```
@@ -29,8 +29,8 @@
 //! assert!(!eq(&a, &b));
 //! assert!(!eq(&a, &c));
 //! ```
-use ffi;
 use libc::size_t;
+use openssl_macros::corresponds;
 
 /// Returns `true` iff `a` and `b` contain the same bytes.
 ///
@@ -44,7 +44,7 @@ use libc::size_t;
 ///
 /// # Examples
 ///
-/// To perform a constant-time comparision of two arrays of the same length but different
+/// To perform a constant-time comparison of two arrays of the same length but different
 /// values:
 ///
 /// ```
@@ -61,6 +61,7 @@ use libc::size_t;
 /// assert!(!eq(&a, &b));
 /// assert!(!eq(&a, &c));
 /// ```
+#[corresponds(CRYPTO_memcmp)]
 pub fn eq(a: &[u8], b: &[u8]) -> bool {
     assert!(a.len() == b.len());
     let ret = unsafe {