-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
2,030 additions
and
1,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 33 additions & 47 deletions
80
gen-val/json-files/LMS-sigVer-1.0/internalProjection.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,14 +33,6 @@ | |
{ | ||
"tcId": 8, | ||
"result": "passed" | ||
}, | ||
{ | ||
"tcId": 9, | ||
"result": "passed" | ||
}, | ||
{ | ||
"tcId": 10, | ||
"result": "passed" | ||
} | ||
] | ||
} |
330 changes: 186 additions & 144 deletions
330
gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/expectedResults.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,550 changes: 814 additions & 736 deletions
1,550
gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/internalProjection.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,153 changes: 713 additions & 440 deletions
1,153
gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/prompt.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
gen-val/src/crypto/test/NIST.CVP.ACVTS.Libraries.Crypto.LMS.Tests/Native/LmsTests.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
....Generation/RSA/SP800_56Br2/DpComponent/TestCaseExpectations/TestCaseExpectationReason.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using NIST.CVP.ACVTS.Libraries.Common.Helpers; | ||
using NIST.CVP.ACVTS.Libraries.Generation.Core; | ||
using NIST.CVP.ACVTS.Libraries.Oracle.Abstractions.DispositionTypes; | ||
|
||
namespace NIST.CVP.ACVTS.Libraries.Generation.RSA.Sp800_56Br2.DpComponent.TestCaseExpectations{ | ||
public class TestCaseExpectationReason : ITestCaseExpectationReason<RsaDpDisposition> | ||
{ | ||
private readonly RsaDpDisposition _reason; | ||
|
||
public TestCaseExpectationReason(RsaDpDisposition reason) | ||
{ | ||
_reason = reason; | ||
} | ||
|
||
public string GetName() | ||
{ | ||
return EnumHelpers.GetEnumDescriptionFromEnum(_reason); | ||
} | ||
|
||
public RsaDpDisposition GetReason() | ||
{ | ||
return _reason; | ||
} | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...neration/RSA/SP800_56Br2/DpComponent/TestCaseExpectations/TestCaseExpectationsProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Collections.Generic; | ||
using NIST.CVP.ACVTS.Libraries.Common.ExtensionMethods; | ||
using NIST.CVP.ACVTS.Libraries.Generation.Core; | ||
using NIST.CVP.ACVTS.Libraries.Oracle.Abstractions.DispositionTypes; | ||
|
||
namespace NIST.CVP.ACVTS.Libraries.Generation.RSA.Sp800_56Br2.DpComponent.TestCaseExpectations | ||
{ | ||
public class TestCaseExpectationProvider : ITestCaseExpectationProvider<RsaDpDisposition> | ||
{ | ||
private readonly ConcurrentQueue<TestCaseExpectationReason> _expectationReasons; | ||
|
||
public int ExpectationCount { get; set; } | ||
private int NumberOfTestCasesToGenerate { get; set; } = 15; | ||
|
||
public TestCaseExpectationProvider(bool isSample = false) | ||
{ | ||
List<TestCaseExpectationReason> expectationReasons = new List<TestCaseExpectationReason>(); | ||
|
||
if (isSample) | ||
{ | ||
NumberOfTestCasesToGenerate -= 5; | ||
} | ||
|
||
// We always want 4 failing test cases per group, randomized throughout the test case list | ||
expectationReasons.Add(new TestCaseExpectationReason(RsaDpDisposition.CtEqual0)); | ||
expectationReasons.Add(new TestCaseExpectationReason(RsaDpDisposition.CtEqual1)); | ||
expectationReasons.Add(new TestCaseExpectationReason(RsaDpDisposition.CtEqualNMinusOne)); | ||
expectationReasons.Add(new TestCaseExpectationReason(RsaDpDisposition.CtGreaterNMinusOne)); | ||
|
||
int i = 4; | ||
// Add the remaining passing cases | ||
while (i++ < NumberOfTestCasesToGenerate) | ||
{ | ||
expectationReasons.Add(new TestCaseExpectationReason(RsaDpDisposition.None)); | ||
} | ||
|
||
// Randomize list and stuff it into the Queue for easier iteration/bounds checking | ||
_expectationReasons = new ConcurrentQueue<TestCaseExpectationReason>(expectationReasons.Shuffle()); | ||
ExpectationCount = _expectationReasons.Count; | ||
} | ||
|
||
// Is random since it's shuffled in the constructor | ||
public ITestCaseExpectationReason<RsaDpDisposition> GetRandomReason() | ||
{ | ||
if (_expectationReasons.TryDequeue(out var reason)) | ||
{ | ||
return reason; | ||
} | ||
|
||
throw new IndexOutOfRangeException($"No {nameof(_expectationReasons)} remaining to pull"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.