From 3405811f847e55407c8f6187c3108e8927cbd97f Mon Sep 17 00:00:00 2001 From: AnarchistHoneybun Date: Sat, 12 Oct 2024 15:56:38 +0530 Subject: [PATCH] fmt pass --- kupyna/src/tests/padding_tests.rs | 84 ++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/kupyna/src/tests/padding_tests.rs b/kupyna/src/tests/padding_tests.rs index 6e4b8dcd..50db4286 100644 --- a/kupyna/src/tests/padding_tests.rs +++ b/kupyna/src/tests/padding_tests.rs @@ -7,7 +7,8 @@ use hex_literal::hex; fn pad_test_0() { let message: [u8; 0] = []; - let expected_output: [u8; 128] = hex!(" + let expected_output: [u8; 128] = hex!( + " 80000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 @@ -16,7 +17,8 @@ fn pad_test_0() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 0, STATE_SIZE_512); @@ -27,7 +29,8 @@ fn pad_test_0() { fn pad_test_8() { let message: [u8; 1] = hex!("FF"); - let expected_output: [u8; 128] = hex!(" + let expected_output: [u8; 128] = hex!( + " FF800000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 @@ -36,7 +39,8 @@ fn pad_test_8() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 08000000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 8, STATE_SIZE_512); @@ -45,14 +49,17 @@ fn pad_test_8() { #[test] fn pad_test_510() { - let message: [u8; 64] = hex!(" + let message: [u8; 64] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3C - "); + " + ); - let expected_output: [u8; 128] = hex!(" + let expected_output: [u8; 128] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -61,7 +68,8 @@ fn pad_test_510() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 FE010000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 510, STATE_SIZE_512); @@ -70,14 +78,17 @@ fn pad_test_510() { #[test] fn pad_test_512() { - let message: [u8; 64] = hex!(" + let message: [u8; 64] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3F - "); + " + ); - let expected_output: [u8; 128] = hex!(" + let expected_output: [u8; 128] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -86,7 +97,8 @@ fn pad_test_512() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00020000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 512, STATE_SIZE_512); @@ -95,7 +107,8 @@ fn pad_test_512() { #[test] fn pad_test_1024() { - let message: [u8; 128] = hex!(" + let message: [u8; 128] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -104,9 +117,11 @@ fn pad_test_1024() { 50515253 54555657 58595A5B 5C5D5E5F 60616263 64656667 68696A6B 6C6D6E6F 70717273 74757677 78797A7B 7C7D7E7F - "); + " + ); - let expected_output: [u8; 256] = hex!(" + let expected_output: [u8; 256] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -123,7 +138,8 @@ fn pad_test_1024() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00040000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 1024, STATE_SIZE_512); @@ -132,7 +148,8 @@ fn pad_test_1024() { #[test] fn pad_test_2048() { - let message: [u8; 256] = hex!(" + let message: [u8; 256] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -149,9 +166,11 @@ fn pad_test_2048() { D0D1D2D3 D4D5D6D7 D8D9DADB DCDDDEDF E0E1E2E3 E4E5E6E7 E8E9EAEB ECEDEEEF F0F1F2F3 F4F5F6F7 F8F9FAFB FCFDFEFF - "); + " + ); - let expected_output: [u8; 384] = hex!(" + let expected_output: [u8; 384] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -176,7 +195,8 @@ fn pad_test_2048() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00080000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 2048, STATE_SIZE_512); @@ -185,7 +205,8 @@ fn pad_test_2048() { #[test] fn pad_test_1536() { - let message: [u8; 192] = hex!(" + let message: [u8; 192] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -198,9 +219,11 @@ fn pad_test_1536() { 90919293 94959697 98999A9B 9C9D9E9F A0A1A2A3 A4A5A6A7 A8A9AAAB ACADAEAF B0B1B2B3 B4B5B6B7 B8B9BABB BCBDBEBF - "); + " + ); - let expected_output: [u8; 256] = hex!(" + let expected_output: [u8; 256] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -217,7 +240,8 @@ fn pad_test_1536() { 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00060000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 1536, STATE_SIZE_512); @@ -226,16 +250,19 @@ fn pad_test_1536() { #[test] fn pad_test_655() { - let message: [u8; 82] = hex!(" + let message: [u8; 82] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F 30313233 34353637 38393A3B 3C3D3E3F 40414243 44454647 48494A4B 4C4D4E4F 5050 - "); + " + ); - let expected_output: [u8; 128] = hex!(" + let expected_output: [u8; 128] = hex!( + " 00010203 04050607 08090A0B 0C0D0E0F 10111213 14151617 18191A1B 1C1D1E1F 20212223 24252627 28292A2B 2C2D2E2F @@ -244,7 +271,8 @@ fn pad_test_655() { 50510000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 8F020000 00000000 00000000 - "); + " + ); let padded_message = pad_message(&message, 655, STATE_SIZE_512);