File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
DynamoDbEncryption/dafny/DynamoDbEncryption/src Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -357,7 +357,10 @@ module DynamoToStruct {
357357 && U32ToBigEndian (|a.L|). Success?
358358 && |ret. value| >= PREFIX_LEN + LENGTH_LEN
359359 && ret. value[0.. TYPEID_LEN] == SE. LIST
360- // && ret.value[PREFIX_LEN..PREFIX_LEN+LENGTH_LEN] == U32ToBigEndian(|a.L|).value
360+ && ListAttrToBytes (a.L, depth). Success?
361+ && ret. value[PREFIX_LEN.. ] == ListAttrToBytes (a.L, depth). value
362+ && ListAttrToBytes (a.L, depth). value[.. LENGTH_LEN] == U32ToBigEndian (|a.L|). value
363+ && ret. value[PREFIX_LEN.. PREFIX_LEN+ LENGTH_LEN] == U32ToBigEndian (|a.L|). value
361364 && (|a. L| == 0 ==> |ret. value| == PREFIX_LEN + LENGTH_LEN)
362365
363366 // = specification/dynamodb-encryption-client/ddb-attribute-serialization.md#map-attribute
@@ -492,6 +495,10 @@ module DynamoToStruct {
492495 }
493496
494497 function method ListAttrToBytes (l: ListAttributeValue , depth : nat ): (ret: Result< seq < uint8> , string > )
498+ ensures ret. Success? ==>
499+ && U32ToBigEndian (|l|). Success?
500+ && LENGTH_LEN <= |ret. value|
501+ && ret. value[.. LENGTH_LEN] == U32ToBigEndian (|l|). value
495502 {
496503 var count :- U32ToBigEndian (|l|);
497504 var body :- CollectList (l, depth);
You can’t perform that action at this time.
0 commit comments