@@ -188,9 +188,9 @@ mod test_key_material {
188188 assert_eq ! ( key. key_type( ) , KeyType :: Zeroized ) ;
189189
190190 // zeroize() must wipe the entire backing buffer.
191- // Full capacity must be inspected to confirm the previously-set bytes were
191+ // Full capacity must be inspected to confirm the previously-set bytes were
192192 // actually overwritten with zeros.
193- // Note: key_len is now 0, so ref_to_bytes() returns an empty slice.
193+ // Note: key_len is now 0, so ref_to_bytes() returns an empty slice.
194194 key. allow_hazardous_operations ( ) ;
195195 let full_buf = key. mut_ref_to_bytes ( ) . unwrap ( ) ;
196196 assert_eq ! ( full_buf. len( ) , capacity) ;
@@ -296,7 +296,7 @@ mod test_key_material {
296296 Ok ( ( ) ) => { /* good */ }
297297 _ => panic ! ( "Expected Ok(())" ) ,
298298 }
299-
299+
300300 // each KeyType can convert to itself
301301
302302 let mut key = KeyMaterial256 :: from_bytes ( & DUMMY_KEY [ ..32 ] ) . unwrap ( ) ;
@@ -702,12 +702,12 @@ mod test_key_material {
702702
703703 #[ test]
704704 fn eq ( ) {
705- // For context:
705+ // For context:
706706 // DUMMY_KEY: &[u8; 64] = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\
707707 // \x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\
708708 // \x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\
709709 // \x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F";
710-
710+
711711 // Same bytes, full capacity. Should be equal.
712712 let key1 = KeyMaterial256 :: from_bytes ( & DUMMY_KEY [ ..32 ] ) . unwrap ( ) ;
713713 let key2 = KeyMaterial256 :: from_bytes ( & DUMMY_KEY [ ..32 ] ) . unwrap ( ) ;
@@ -722,13 +722,19 @@ mod test_key_material {
722722 assert_ne ! ( key1, key_short) ;
723723
724724 // PartialEq ignores key_type: same bytes, different KeyType. Should be equal.
725- let key_low = KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesLowEntropy ) . unwrap ( ) ;
726- let key_mac = KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: MACKey ) . unwrap ( ) ;
725+ let key_low =
726+ KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesLowEntropy ) . unwrap ( ) ;
727+ let key_mac =
728+ KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: MACKey ) . unwrap ( ) ;
727729 assert_eq ! ( key_low, key_mac) ;
728730
729731 // PartialEq ignores security_strength: same bytes, different strength. Should be equal.
730- let key_strong = KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesFullEntropy ) . unwrap ( ) ;
731- let mut key_weak = KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesFullEntropy ) . unwrap ( ) ;
732+ let key_strong =
733+ KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesFullEntropy )
734+ . unwrap ( ) ;
735+ let mut key_weak =
736+ KeyMaterial256 :: from_bytes_as_type ( & DUMMY_KEY [ ..32 ] , KeyType :: BytesFullEntropy )
737+ . unwrap ( ) ;
732738 key_weak. set_security_strength ( SecurityStrength :: _128bit) . unwrap ( ) ;
733739 assert_ne ! ( key_strong. security_strength( ) , key_weak. security_strength( ) ) ; // strengths differ
734740 assert_eq ! ( key_strong, key_weak) ; // but keys are still equal
0 commit comments