Skip to content

Commit a952fc3

Browse files
authored
test: fix test vector required ec cmm construction (#910)
1 parent 5669e0b commit a952fc3

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/src/VectorsComposition/AllRequiredEncryptionContextCmm.dfy

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module {:options "-functionSyntax:4"} AllRequiredEncryptionContextCmm {
3939
s <- AllDefaultCmm.SubSets(
4040
encryptionContext,
4141
SortedSets.ComputeSetToOrderedSequence2(encryptionContext.Keys, (a, b) => a < b))
42+
| |s| != 0
4243
:: s.Keys,
4344
reproducedEncryptionContext
4445
<- set
@@ -52,8 +53,18 @@ module {:options "-functionSyntax:4"} AllRequiredEncryptionContextCmm {
5253
name := "Success testing requiredEncryptionContextKeys/reproducedEncryptionContext",
5354
commitmentPolicy := AllAlgorithmSuites.GetCompatibleCommitmentPolicy(AllDefaultCmm.StaticAlgorithmSuite),
5455
algorithmSuite := AllDefaultCmm.StaticAlgorithmSuite,
55-
encryptDescription := AllDefaultCmm.RawAesKeyring,
56-
decryptDescription := AllDefaultCmm.RawAesKeyring,
56+
encryptDescription := KeyVectorsTypes.RequiredEncryptionContext(
57+
KeyVectorsTypes.RequiredEncryptionContextCMM(
58+
underlying := AllDefaultCmm.RawAesKeyring,
59+
requiredEncryptionContextKeys := SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)
60+
)
61+
),
62+
decryptDescription := KeyVectorsTypes.RequiredEncryptionContext(
63+
KeyVectorsTypes.RequiredEncryptionContextCMM(
64+
underlying := AllDefaultCmm.RawAesKeyring,
65+
requiredEncryptionContextKeys := SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)
66+
)
67+
),
5768
encryptionContext := encryptionContext,
5869
requiredEncryptionContextKeys := Some(SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)),
5970
reproducedEncryptionContext := Some(reproducedEncryptionContext)
@@ -67,6 +78,7 @@ module {:options "-functionSyntax:4"} AllRequiredEncryptionContextCmm {
6778
s <- AllDefaultCmm.SubSets(
6879
encryptionContext,
6980
SortedSets.ComputeSetToOrderedSequence2(encryptionContext.Keys, (a, b) => a < b))
81+
| |s| != 0
7082
:: s.Keys,
7183
incorrectEncryptionContext
7284
<- set
@@ -87,8 +99,18 @@ module {:options "-functionSyntax:4"} AllRequiredEncryptionContextCmm {
8799
decryptErrorDescription := "The reproducedEncryptionContext is not correct",
88100
commitmentPolicy := AllAlgorithmSuites.GetCompatibleCommitmentPolicy(AllDefaultCmm.StaticAlgorithmSuite),
89101
algorithmSuite := AllDefaultCmm.StaticAlgorithmSuite,
90-
encryptDescription := AllDefaultCmm.RawAesKeyring,
91-
decryptDescription := AllDefaultCmm.RawAesKeyring,
102+
encryptDescription := KeyVectorsTypes.RequiredEncryptionContext(
103+
KeyVectorsTypes.RequiredEncryptionContextCMM(
104+
underlying := AllDefaultCmm.RawAesKeyring,
105+
requiredEncryptionContextKeys := SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)
106+
)
107+
),
108+
decryptDescription := KeyVectorsTypes.RequiredEncryptionContext(
109+
KeyVectorsTypes.RequiredEncryptionContextCMM(
110+
underlying := AllDefaultCmm.RawAesKeyring,
111+
requiredEncryptionContextKeys := SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)
112+
)
113+
),
92114
encryptionContext := encryptionContext,
93115
requiredEncryptionContextKeys := Some(SortedSets.ComputeSetToSequence(requiredEncryptionContextKeys)),
94116
reproducedEncryptionContext := Some(reproducedEncryptionContext)

0 commit comments

Comments
 (0)