diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml index b00cb4f..70ed1ec 100644 --- a/sha2/Cargo.toml +++ b/sha2/Cargo.toml @@ -11,7 +11,7 @@ categories = ["cryptography", "no-std"] edition = "2018" [dependencies] -cpufeatures = "0.2.1" +cpufeatures = "0.2" [build-dependencies] cc = "1.0" diff --git a/sha2/src/lib.rs b/sha2/src/lib.rs index 8fa3ccd..730e6c8 100644 --- a/sha2/src/lib.rs +++ b/sha2/src/lib.rs @@ -43,7 +43,7 @@ pub fn compress256(state: &mut [u32; 8], blocks: &[[u8; 64]]) { #[link(name = "sha512", kind = "static")] extern "C" { fn sha512_compress(state: &mut [u64; 8], block: &[u8; 128]); - fn sha512_transform_rorx(state: &mut [u64; 8], block: *const [u8; 128], num_blocks: u64); + fn sha512_transform_rorx(state: &mut [u64; 8], block: *const [u8; 128], num_blocks: usize); } /// Safe wrapper around assembly implementation of SHA512 compression function @@ -55,7 +55,7 @@ pub fn compress512(state: &mut [u64; 8], blocks: &[[u8; 128]]) { let token: cpuid_avx2::InitToken = cpuid_avx2::init(); if token.get() { if !blocks.is_empty() { - unsafe { sha512_transform_rorx(state, blocks.as_ptr(), blocks.len() as u64) } + unsafe { sha512_transform_rorx(state, blocks.as_ptr(), blocks.len()) } } } else { for block in blocks {