Skip to content

Commit 9366980

Browse files
author
Markus Humm
committed
Further work on Keccak Unit Tests
1 parent 8037b02 commit 9366980

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Unit Tests/Tests/TestDECTestDataContainer.pas

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ interface
9797

9898
IHashTestDataRowSetup = interface(ITestDataRowSetup)
9999
['{ADB4AFA2-4199-47F4-86F6-E84A20C3AA8E}']
100+
function GetInputData:RawByteString;
101+
procedure SetInputData(const aValue: RawByteString);
100102
/// <summary>
101103
/// Specifies the length of the hash value generated for those hash classes
102104
/// which support configurable output lengths.
@@ -234,6 +236,13 @@ interface
234236
/// </summary>
235237
property Salt : TBytes
236238
write SetSalt;
239+
240+
/// <summary>
241+
/// Data to feed the hash algorithm, means to run the test on
242+
/// </summary>
243+
property InputData : RawByteString
244+
read GetInputData
245+
write SetInputData;
237246
end;
238247

239248
IHashTestDataRow = interface(ITestDataRow)
@@ -509,11 +518,12 @@ THashTestDataRow = class(TInterfacedObject, ITestDataRow, ITestDataRowSetup,
509518
/// </summary>
510519
FSalt : TBytes;
511520
protected // ITestDataRow
512-
function GetInputData:RawByteString;
513521
function GetInputVectors:ITestDataInputVectorList;
514522
function GetOutputData:RawByteString;
515523
function GetOutputUTFStrTest:RawByteString;
516524
protected // ITestDataRowSetup
525+
function GetInputData:RawByteString;
526+
procedure SetInputData(const aValue: RawByteString);
517527
procedure SetExpectedOutput(const aValue:RawByteString);
518528
procedure SetExpectedOutputUTFStrTest(const aValue:RawByteString);
519529
procedure AddInputVector(const aData:RawByteString; const aRunCount:UInt32 = 1;
@@ -656,6 +666,12 @@ THashTestDataRow = class(TInterfacedObject, ITestDataRow, ITestDataRowSetup,
656666
public
657667
constructor Create;
658668
destructor Destroy; override;
669+
670+
/// <summary>
671+
/// Data to feed the hash algorithm, means to run the test on
672+
/// </summary>
673+
property InputData : RawByteString
674+
read GetInputData;
659675
end;
660676

661677
/// <summary>
@@ -839,6 +855,11 @@ procedure THashTestDataRow.SetHashResultByteLength(const aValue: UInt16);
839855
FHashResultByteLength := aValue;
840856
end;
841857

858+
procedure THashTestDataRow.SetInputData(const aValue: RawByteString);
859+
begin
860+
FInputData := aValue;
861+
end;
862+
842863
procedure THashTestDataRow.SetPaddingByte(const aValue: Byte);
843864
begin
844865
FPaddingByte := aValue;

0 commit comments

Comments
 (0)