Skip to content

Commit 74779fb

Browse files
committed
RELEASE/v1.1.0.32
1 parent 7e77916 commit 74779fb

File tree

12 files changed

+1567
-1574
lines changed

12 files changed

+1567
-1574
lines changed

gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/expectedResults.json

Lines changed: 94 additions & 94 deletions
Large diffs are not rendered by default.

gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/internalProjection.json

Lines changed: 767 additions & 767 deletions
Large diffs are not rendered by default.

gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/prompt.json

Lines changed: 673 additions & 673 deletions
Large diffs are not rendered by default.

gen-val/json-files/RSA-DecryptionPrimitive-Sp800-56Br2/registration.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
2048,
1414
3072,
1515
4096
16-
]
16+
],
17+
"pubExpMode": "random"
1718
}

gen-val/src/crypto/test/NIST.CVP.ACVTS.Libraries.Crypto.KeyWrap.Tests/KeyWrapAesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void ShouldInvokeAesEncryptAtLeastTwelveTimes(int payloadSize)
8484

8585
_subject.Encrypt(new BitString(128), payload, false);
8686

87-
_cipher.Verify(v => v.ProcessPayload(It.IsAny<IModeBlockCipherParameters>()), Times.Exactly(expectedNumberOfInvocations), $"{expectedNumberOfInvocations} invokations expected.");
87+
_cipher.Verify(v => v.ProcessPayload(It.IsAny<IModeBlockCipherParameters>()), Times.Exactly(expectedNumberOfInvocations), $"{expectedNumberOfInvocations} invocations expected.");
8888
}
8989

9090
[Test]

gen-val/src/generation/src/NIST.CVP.ACVTS.Libraries.Generation/EDDSA/v1_0/SigGen/ParameterValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public ParameterValidateResponse Validate(Parameters parameters)
1818

1919
if (!parameters.PreHash && !parameters.Pure)
2020
{
21-
errors.Add("No valid mode chosen");
21+
errors.Add("No valid signature generation mode chosen; PreHash or Pure must be true");
2222
}
2323

2424
return new ParameterValidateResponse(errors);

gen-val/src/generation/src/NIST.CVP.ACVTS.Libraries.Generation/EDDSA/v1_0/SigVer/ParameterValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public ParameterValidateResponse Validate(Parameters parameters)
2020

2121
if (!parameters.PreHash && !parameters.Pure)
2222
{
23-
errors.Add("No valid mode chosen");
23+
errors.Add("No valid signature generation mode chosen; PreHash or Pure must be true");
2424
}
2525

2626
return new ParameterValidateResponse(errors);

gen-val/src/generation/src/NIST.CVP.ACVTS.Libraries.Generation/RSA/SP800_56Br2/DpComponent/ParameterValidator.cs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,20 @@ public ParameterValidateResponse Validate(Parameters parameters)
1818
errorResults.AddIfNotNullOrEmpty(ValidateArray(parameters.KeyFormat, VALID_KEY_FORMATS, "keyFormat"));
1919
errorResults.AddIfNotNullOrEmpty(ValidateArray(parameters.Modulo, VALID_MODULI, "modulo"));
2020

21-
if (parameters.PublicExponentModes != null)
21+
if (parameters.PublicExponentMode == PublicExponentModes.Invalid)
2222
{
23-
foreach (var mode in parameters.PublicExponentModes)
23+
errorResults.Add("Invalid or no public exponent mode provided");
24+
}
25+
26+
if (parameters.PublicExponentMode == PublicExponentModes.Fixed)
27+
{
28+
if (parameters.PublicExponentValue == null || parameters.PublicExponentValue.BitLength == 0)
29+
{
30+
errorResults.Add("No public exponent provided.");
31+
}
32+
else if (!RsaKeyHelper.IsValidExponent(parameters.PublicExponentValue.ToPositiveBigInteger()))
2433
{
25-
if (mode == PublicExponentModes.Invalid)
26-
{
27-
errorResults.Add("Invalid public exponent mode provided");
28-
}
29-
else if (mode== PublicExponentModes.Fixed)
30-
{
31-
if (parameters.PublicExponentValue == null || parameters.PublicExponentValue.BitLength == 0)
32-
{
33-
errorResults.Add("No public exponent provided.");
34-
}
35-
else if (!RsaKeyHelper.IsValidExponent(parameters.PublicExponentValue.ToPositiveBigInteger()))
36-
{
37-
errorResults.Add("Invalid public exponent provided.");
38-
}
39-
}
34+
errorResults.Add("Invalid public exponent provided.");
4035
}
4136
}
4237

gen-val/src/generation/src/NIST.CVP.ACVTS.Libraries.Generation/RSA/SP800_56Br2/DpComponent/Parameters.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public class Parameters : IParameters
1818

1919
[JsonProperty(PropertyName = "modulo")]
2020
public int[] Modulo { get; set; }
21-
21+
2222
[JsonProperty(PropertyName = "pubExpMode")]
23-
public PublicExponentModes[] PublicExponentModes { get; set; }
23+
public PublicExponentModes PublicExponentMode { get; set; }
2424

2525
[JsonProperty(PropertyName = "fixedPubExp")]
2626
public BitString PublicExponentValue = null;

gen-val/src/generation/src/NIST.CVP.ACVTS.Libraries.Generation/RSA/SP800_56Br2/DpComponent/TestGroupGenerator.cs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public Task<List<TestGroup>> BuildTestGroupsAsync(Parameters parameters)
1818
{
1919
foreach (var modulus in parameters.Modulo)
2020
{
21-
if (parameters.PublicExponentModes == null)
21+
if (parameters.PublicExponentMode == PublicExponentModes.Random)
2222
{
2323
groups.Add(new TestGroup
2424
{
@@ -32,18 +32,15 @@ public Task<List<TestGroup>> BuildTestGroupsAsync(Parameters parameters)
3232
}
3333
else
3434
{
35-
foreach (var mode in parameters.PublicExponentModes)
35+
groups.Add(new TestGroup
3636
{
37-
groups.Add(new TestGroup
38-
{
39-
Modulo = modulus,
40-
KeyMode = format,
41-
TestType = TEST_TYPE,
42-
TestCaseExpectationProvider = new TestCaseExpectationProvider(parameters.IsSample),
43-
PublicExponentMode = mode,
44-
PublicExponent = mode == PublicExponentModes.Fixed ? parameters.PublicExponentValue : null
45-
});
46-
}
37+
Modulo = modulus,
38+
KeyMode = format,
39+
TestType = TEST_TYPE,
40+
TestCaseExpectationProvider = new TestCaseExpectationProvider(parameters.IsSample),
41+
PublicExponentMode = parameters.PublicExponentMode,
42+
PublicExponent = parameters.PublicExponentMode == PublicExponentModes.Fixed ? parameters.PublicExponentValue : null
43+
});
4744
}
4845
}
4946
}

0 commit comments

Comments
 (0)