Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0140e8c

Browse files
committedMar 28, 2024
verification speed
1 parent fd9992b commit 0140e8c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎DynamoDbEncryption/dafny/StructuredEncryption/src/AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations.dfy

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,15 @@ module AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations refines Abst
411411
else
412412
SIGN_ONLY;
413413

414+
assert ValidParsedCryptoSchema(cryptoSchema, authSchema, tableName) by {
415+
assert forall k <- cryptoSchema.Keys :: k in authSchema && authSchema[k].SIGN?;
416+
assert forall k <- fieldMap :: authSchema[fieldMap[k]].SIGN?;
417+
assert forall k <- fieldMap :: fieldMap[k] in cryptoSchema;
418+
assert forall k <- authSchema | authSchema[k].SIGN? :: fieldMap[Paths.SimpleCanon(tableName, k)] in cryptoSchema;
419+
assert forall k <- authSchema | authSchema[k].SIGN? :: k in cryptoSchema;
420+
assert forall k <- authSchema | authSchema[k].SIGN? :: k in cryptoSchema.Keys;
421+
assert forall v <- cryptoSchema.Values :: IsAuthAttr(v);
422+
}
414423
assert forall k :: k in data.Keys && authSchema[k].SIGN? ==> Paths.SimpleCanon(tableName, k) in data_c.Keys;
415424

416425
var c := DecryptCanonData(
@@ -730,7 +739,7 @@ module AwsCryptographyDbEncryptionSdkStructuredEncryptionOperations refines Abst
730739
// Every field in the crypto map exists in the auth map as SIGN
731740
&& (forall k <- cryptoSchema.Keys :: k in authSchema && authSchema[k].SIGN?)
732741
// The crypto map is not missing any SIGN fields from the auth map
733-
&& (forall kv <- authSchema.Items | kv.1.SIGN? :: kv.0 in cryptoSchema.Keys)
742+
&& (forall k <- authSchema | authSchema[k].SIGN? :: k in cryptoSchema.Keys)
734743
// Every field in the crypto map is ENCRYPT_AND_SIGN, SIGN_AND_INCLUDE_IN_ENCRYPTION_CONTEXT or SIGN_ONLY
735744
&& (forall v <- cryptoSchema.Values :: IsAuthAttr(v))
736745
}

0 commit comments

Comments
 (0)
Please sign in to comment.