diff --git a/src/fake_sign/modified_md5.rs b/src/fake_sign/modified_md5.rs index 0657bfa..1414ef6 100644 --- a/src/fake_sign/modified_md5.rs +++ b/src/fake_sign/modified_md5.rs @@ -67,7 +67,7 @@ impl Context { /// Consume data. #[cfg(target_pointer_width = "64")] pub fn consume>(&mut self, data: T) { - for chunk in data.as_ref().chunks(core::u32::MAX as usize) { + for chunk in data.as_ref().chunks(u32::MAX as usize) { consume(self, chunk); } } @@ -113,9 +113,6 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) { macro_rules! add( ($a:expr, $b:expr) => ($a.wrapping_add($b)); ); - macro_rules! rotate( - ($x:expr, $n:expr) => (($x << $n) | ($x >> (32 - $n))); - ); { macro_rules! F( ($x:expr, $y:expr, $z:expr) => (($x & $y) | (!$x & $z)); @@ -123,7 +120,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) { macro_rules! T( ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); + $a = $a.rotate_left($s); $a = add!($a, $b); }); ); @@ -155,7 +152,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) { macro_rules! T( ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); + $a = $a.rotate_left($s); $a = add!($a, $b); }); ); @@ -187,7 +184,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) { macro_rules! T( ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); + $a = $a.rotate_left($s); $a = add!($a, $b); }); ); @@ -219,7 +216,7 @@ fn transform(state: &mut [u32; 4], input: &[u32; 16]) { macro_rules! T( ($a:expr, $b:expr, $c:expr, $d:expr, $x:expr, $s:expr, $ac:expr) => ({ $a = add!(add!(add!($a, F!($b, $c, $d)), $x), $ac); - $a = rotate!($a, $s); + $a = $a.rotate_left($s); $a = add!($a, $b); }); ); diff --git a/src/lib.rs b/src/lib.rs index 713a845..7c61591 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ #![allow(non_upper_case_globals)] #![allow( clippy::transmute_ptr_to_ptr, // Introduced by com-rs - clippy::too_many_arguments, // We're wrapping and API outside of our control + clippy::too_many_arguments, // We're wrapping an API outside of our control clippy::uninlined_format_args, // Unfavourable format; implies unneeded MSRV bump )] diff --git a/src/wrapper.rs b/src/wrapper.rs index ee0d53a..7b018e3 100644 --- a/src/wrapper.rs +++ b/src/wrapper.rs @@ -210,6 +210,7 @@ impl DxcIncludeHandlerWrapper { library: &'_ DxcLibrary, include_handler: &'_ mut dyn DxcIncludeHandler, ) -> LocalClassAllocation { + #[allow(clippy::missing_transmute_annotations)] LocalClassAllocation::new(Self::allocate( std::mem::transmute(library), RefCell::new(std::mem::transmute(include_handler)),