Skip to content

Commit

Permalink
Reduce and clarify difference in verification
Browse files Browse the repository at this point in the history
  • Loading branch information
atomb committed Aug 22, 2024
1 parent a79e9f5 commit 05d7945
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ module DefaultCMM {
//# the values MUST be equal or the operation MUST fail.
ensures
&& (output.Success? ==> CMM.ReproducedEncryptionContext?(input))
ensures
&& (!CMM.ReproducedEncryptionContext?(input) ==> output.Failure?)
//= aws-encryption-sdk-specification/framework/cmm-interface.md#decrypt-materials
//= type=implication
Expand Down Expand Up @@ -490,10 +489,10 @@ module DefaultCMM {
invariant |keysSet'| == |keysSeq| - i
invariant forall key
|
&& key in input.reproducedEncryptionContext.value.Keys
&& key in input.reproducedEncryptionContext.value
&& key in input.encryptionContext
&& key !in keysSet'
:: input.encryptionContext[key] == input.reproducedEncryptionContext.value[key]
:: input.reproducedEncryptionContext.value[key] == input.encryptionContext[key]
invariant forall key <- requiredEncryptionContextKeys
:: key !in input.encryptionContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ module RequiredEncryptionContextCMM {
{
var keySet := inputKeys;
var keySeq := SortedSets.ComputeSetToSequence(keySet);

assert |keySeq| == |keySet| == |inputKeys|;
assert forall k <- keySeq
:: k in inputKeys;
underlyingCMM := inputCMM;
requiredEncryptionContextKeys := keySeq;

Expand Down

0 comments on commit 05d7945

Please sign in to comment.