static byte[] HashFile_SHA3_512(string filePath) { var sha3 = Sha3Permutation.Sha3_512(); var fileBytes = File.ReadAllBytes(filePath); return(sha3.Process(fileBytes, 512, fileBytes.Length)); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage1630() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message1630; var res = new BitString(sha3.Process(input.Bytes, 512, 1630)).ToHexString(); Assert.AreEqual("CF 9A 30 AC 1F 1F 6A C0 91 6F 9F EF 19 19 C5 95 DE BE 2E E8 0C 85 42 12 10 FD F0 5F 1C 6A F7 3A A9 CA C8 81 D0 F9 1D B6 D0 34 A2 BB AD C1 CF 7F BC B2 EC FA 9D 19 1D 3A 50 16 FB 3F AD 87 09 C9", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage1605() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message1605; var res = new BitString(sha3.Process(input.Bytes, 512, 1605)).ToHexString(); Assert.AreEqual("FC 4A 16 7C CB 31 A9 37 D6 98 FD E8 2B 04 34 8C 95 39 B2 8F 0C 9D 3B 45 05 70 9C 03 81 23 50 E4 99 0E 96 22 97 4F 6E 57 5C 47 86 1C 0D 2E 63 8C CF C2 02 3C 36 5B B6 0A 93 F5 28 55 06 98 78 6B", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage1600() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message1600; var res = new BitString(sha3.Process(input.Bytes, 512)).ToHexString(); Assert.AreEqual("E7 6D FA D2 20 84 A8 B1 46 7F CF 2F FA 58 36 1B EC 76 28 ED F5 F3 FD C0 E4 80 5D C4 8C AE EC A8 1B 7C 13 C3 0A DF 52 A3 65 95 84 73 9A 2D F4 6B E5 89 C5 1C A1 A4 A8 41 6D F6 54 5A 1C E8 BA 00", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage896() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message896; var res = new BitString(sha3.Process(input.Bytes, 512)).ToHexString(); Assert.AreEqual("AF EB B2 EF 54 2E 65 79 C5 0C AD 06 D2 E5 78 F9 F8 DD 68 81 D7 DC 82 4D 26 36 0F EE BF 18 A4 FA 73 E3 26 11 22 94 8E FC FD 49 2E 74 E8 2E 21 89 ED 0F B4 40 D1 87 F3 82 27 0C B4 55 F2 1D D1 85", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage448() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message448; var res = new BitString(sha3.Process(input.Bytes, 512)).ToHexString(); Assert.AreEqual("04 A3 71 E8 4E CF B5 B8 B7 7C B4 86 10 FC A8 18 2D D4 57 CE 6F 32 6A 0F D3 D7 EC 2F 1E 91 63 6D EE 69 1F BE 0C 98 53 02 BA 1B 0D 8D C7 8C 08 63 46 B5 33 B4 9C 03 0D 99 A2 7D AF 11 39 D6 E7 5E", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage30() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message30; var res = new BitString(sha3.Process(input.Bytes, 512, 30)).ToHexString(); Assert.AreEqual("98 34 C0 5A 11 E1 C5 D3 DA 9C 74 0E 1C 10 6D 9E 59 0A 0E 53 0B 6F 6A AA 78 30 52 5D 07 5C A5 DB 1B D8 A6 AA 98 1A 28 61 3A C3 34 93 4A 01 82 3C D4 5F 45 E4 9B 6D 7E 69 17 F2 F1 67 78 06 7B AB", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage24() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message24; var res = new BitString(sha3.Process(input.Bytes, 512)).ToHexString(); Assert.AreEqual("B7 51 85 0B 1A 57 16 8A 56 93 CD 92 4B 6B 09 6E 08 F6 21 82 74 44 F7 0D 88 4F 5D 02 40 D2 71 2E 10 E1 16 E9 19 2A F3 C9 1A 7E C5 76 47 E3 93 40 57 34 0B 4C F4 08 D5 A5 65 92 F8 27 4E EC 53 F0", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage5() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message5; var res = new BitString(sha3.Process(input.Bytes, 512, 5)).ToHexString(); Assert.AreEqual("A1 3E 01 49 41 14 C0 98 00 62 2A 70 28 8C 43 21 21 CE 70 03 9D 75 3C AD D2 E0 06 E4 D9 61 CB 27 54 4C 14 81 E5 81 4B DC EB 53 BE 67 33 D5 E0 99 79 5E 5E 81 91 8A DD B0 58 E2 2A 9F 24 88 3F 37", res); }
public void Sha3_512_ShouldReturnCorrectHash_Bitstring_WithMessage0() { var sha3 = Sha3Permutation.Sha3_512(); var input = SpongeTests.Message0; var res = new BitString(sha3.Process(input.Bytes, 512)).ToHexString(); Assert.AreEqual("A6 9F 73 CC A2 3A 9A C5 C8 B5 67 DC 18 5A 75 6E 97 C9 82 16 4F E2 58 59 E0 D1 DC C1 47 5C 80 A6 15 B2 12 3A F1 F5 F9 4C 11 E3 E9 40 2C 3A C5 58 F5 00 19 9D 95 B6 D3 E3 01 75 85 86 28 1D CD 26", res); }