@@ -571,6 +571,7 @@ procedure TestTHash_SHA3_Base.LoadTestDataFile(FileName : string;
571
571
{ TODO :
572
572
Problem: here the method from the base class is called instead the
573
573
overwritten one from Keccack... }
574
+ { Daniel Marschall 5 May 2024: No, since it is virtual, TestTHash_Keccak_Base.AddLastByteForCodeTest is correctly called }
574
575
MsgWithFixup := AddLastByteForKeccakTest(' ' , FinalByteLen);
575
576
lDataRow.AddInputVector(MsgWithFixup);
576
577
lDataRow.FinalBitLength := FinalByteLen;
@@ -1755,14 +1756,13 @@ procedure TestTHash_SHA3_Base.AddLastByteForCodeTest(var lDataRow : IHashTest
1755
1756
SHA3InputVector : RawByteString;
1756
1757
LastByteLength : UInt8);
1757
1758
var
1758
- LastByteLen : UInt8;
1759
1759
MsgWithFixup : RawByteString;
1760
1760
begin
1761
- MsgWithFixup := AddLastByteForKeccakTest(SHA3InputVector, LastByteLen );
1761
+ MsgWithFixup := AddLastByteForKeccakTest(SHA3InputVector, LastByteLength );
1762
1762
lDataRow.AddInputVector(MsgWithFixup);
1763
- lDataRow.FinalBitLength := LastByteLen ;
1763
+ lDataRow.FinalBitLength := LastByteLength ;
1764
1764
1765
- THash_SHA3Base(FHash).FinalByteLength := LastByteLen ;
1765
+ THash_SHA3Base(FHash).FinalByteLength := LastByteLength ;
1766
1766
1767
1767
lDataRow.ExpectedOutputUTFStrTest :=
1768
1768
CalcUnicodeHash(string(TFormat_HexL.Encode(MsgWithFixup)), FHash);
@@ -1845,11 +1845,11 @@ procedure TestTHash_Keccak_224.SetUp;
1845
1845
lDataRow := FTestData.AddRow;
1846
1846
lDataRow.ExpectedOutput := ' ffbad5da96bad71789330206dc6768ecaeb1b32d' +
1847
1847
' ca6b3301489674ab' ;
1848
- lDataRow.AddInputVector(RawByteString(#$19 ), 1 , 1 );
1849
- lDataRow.AddInputVector(RawByteString(#$02 ), 1 , 1 );
1850
- lDataRow.FinalBitLength := 5 ;
1851
- // AddLastByteForCodeTest(lDataRow, #$19 , 5);
1852
- // exit;
1848
+ // lDataRow.AddInputVector(RawByteString(#$19), 1, 1);
1849
+ // lDataRow.AddInputVector(RawByteString(#$02), 1, 1);
1850
+ // lDataRow.FinalBitLength := 5;
1851
+ AddLastByteForCodeTest(lDataRow, #$13 , 5 );
1852
+
1853
1853
//
1854
1854
// // MsgWithFixup := AddLastByteForKeccakTest(
1855
1855
// // TFormat_HexL.Decode(RawByteString(msg)),
@@ -2067,29 +2067,20 @@ procedure TestTHash_Keccak_256.SetUp;
2067
2067
2068
2068
// Source https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-
2069
2069
// and-Guidelines/documents/examples/SHA3-256_Msg5.pdf
2070
- // TODO:
2071
- // expected: <7b0047cf5a456882363cbf0fb05322cf65f4b7059a46365e830132e3b5d957af>
2072
- // but was: <1594a22d1e1dd176e6f35ae26d8efa294589e23676e1fdc917423a1282546528>
2073
2070
lDataRow := FTestData.AddRow;
2074
2071
lDataRow.ExpectedOutput := ' 7b0047cf5a456882363cbf0fb05322cf65f4b705' +
2075
2072
' 9a46365e830132e3b5d957af' ;
2076
2073
AddLastByteForCodeTest(lDataRow, #$13 , 5 );
2077
2074
2078
2075
// Source https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-
2079
2076
// and-Guidelines/documents/examples/SHA3-256_Msg30.pdf
2080
- // TODO:
2081
- // expected: <c8242fef409e5ae9d1f1c857ae4dc624b92b19809f62aa8c07411c54a078b1d0>
2082
- // but was: <ce8c2109c14e5416785a205f34316b50fa11993fac9c7236c643cb5e7b00afbd>
2083
2077
lDataRow := FTestData.AddRow;
2084
2078
lDataRow.ExpectedOutput := ' c8242fef409e5ae9d1f1c857ae4dc624b92b1980' +
2085
2079
' 9f62aa8c07411c54a078b1d0' ;
2086
2080
AddLastByteForCodeTest(lDataRow, #$53 #$58 #$7B#$19 , 30 mod 8 );
2087
2081
2088
2082
// Source https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-
2089
2083
// and-Guidelines/documents/examples/SHA3-256_Msg1605.pdf
2090
- // TODO:
2091
- // expected: <81ee769bed0950862b1ddded2e84aaa6ab7bfdd3ceaa471be31163d40336363c>
2092
- // but was: <ffc38f204f021c3adf97c55e0d453904749b6ad71c15612f60d018e946d00c24>
2093
2084
lDataRow := FTestData.AddRow;
2094
2085
lDataRow.ExpectedOutput := ' 81ee769bed0950862b1ddded2e84aaa6ab7bfdd3' +
2095
2086
' ceaa471be31163d40336363c' ;
@@ -2118,9 +2109,6 @@ procedure TestTHash_Keccak_256.SetUp;
2118
2109
2119
2110
// Source https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-
2120
2111
// and-Guidelines/documents/examples/SHA3-256_1630.pdf
2121
- // TODO:
2122
- // expected: <52860aa301214c610d922a6b6cab981ccd06012e54ef689d744021e738b9ed20>
2123
- // but was: <96eb974c5cfdfc80fe2e8b0203652998827cda5b8ecd2a99ab90e653ed1eacc1>
2124
2112
lDataRow := FTestData.AddRow;
2125
2113
lDataRow.ExpectedOutput := ' 52860aa301214c610d922a6b6cab981ccd06012e' +
2126
2114
' 54ef689d744021e738b9ed20' ;
0 commit comments