@@ -541,9 +541,7 @@ module DynamoToStruct {
541
541
// See "The Parent Trick" for details: <https://leino.science/papers/krml283.html>.
542
542
function method MapAttrToBytes (ghost parent: AttributeValue , m: MapAttributeValue , depth : nat ): (ret: Result< seq < uint8> , string > )
543
543
requires forall kv < - m. Items :: kv. 1 < parent
544
- ensures MAX_MAP_SIZE < |m| ==> ret. Failure?
545
544
{
546
- :- Need (|m| <= MAX_MAP_SIZE, "Map exceeds limit of " + MAX_MAP_SIZE_STR + " entries.");
547
545
// = specification/dynamodb-encryption-client/ddb-attribute-serialization.md#value-type
548
546
// # Value Type MUST be the [Type ID](#type-id) of the type of [Map Value](#map-value).
549
547
@@ -565,9 +563,7 @@ module DynamoToStruct {
565
563
}
566
564
567
565
function method ListAttrToBytes (l: ListAttributeValue , depth : nat ): (ret: Result< seq < uint8> , string > )
568
- ensures MAX_LIST_LENGTH < |l| ==> ret. Failure?
569
566
{
570
- :- Need (|l| <= MAX_LIST_LENGTH, "List exceeds limit of " + MAX_LIST_LENGTH_STR + " entries.");
571
567
var count :- U32ToBigEndian (|l|);
572
568
var body :- CollectList (l, depth);
573
569
Success (count + body)
@@ -917,7 +913,6 @@ module DynamoToStruct {
917
913
resultList : AttrValueAndLength )
918
914
: (ret : Result< AttrValueAndLength, string > )
919
915
requires resultList. val. L?
920
- requires remainingCount <= MAX_LIST_LENGTH
921
916
ensures ret. Success? ==> ret. value. val. L?
922
917
requires |serialized| + resultList. len == origSerializedSize
923
918
ensures ret. Success? ==> ret. value. len <= origSerializedSize
@@ -950,7 +945,6 @@ module DynamoToStruct {
950
945
resultMap : AttrValueAndLength )
951
946
: (ret : Result< AttrValueAndLength, string > )
952
947
requires resultMap. val. M?
953
- requires remainingCount <= MAX_MAP_SIZE
954
948
ensures ret. Success? ==> ret. value. val. M?
955
949
requires |serialized| + resultMap. len == origSerializedSize
956
950
ensures ret. Success? ==> ret. value. len <= origSerializedSize
@@ -1085,7 +1079,6 @@ module DynamoToStruct {
1085
1079
Failure ("List Structured Data has less than 4 bytes")
1086
1080
else
1087
1081
var len :- BigEndianToU32 (value);
1088
- :- Need (len <= MAX_MAP_SIZE, "Map exceeds limit of " + MAX_MAP_SIZE_STR + " entries.");
1089
1082
var value := value[LENGTH_LEN.. ];
1090
1083
DeserializeMap (value, len, |value| + LENGTH_LEN + lengthBytes, depth, AttrValueAndLength(AttributeValue.M(map[]), LENGTH_LEN + lengthBytes))
1091
1084
@@ -1094,7 +1087,6 @@ module DynamoToStruct {
1094
1087
Failure ("List Structured Data has less than 4 bytes")
1095
1088
else
1096
1089
var len :- BigEndianToU32 (value);
1097
- :- Need (len <= MAX_LIST_LENGTH, "List exceeds limit of " + MAX_LIST_LENGTH_STR + " entries.");
1098
1090
var value := value[LENGTH_LEN.. ];
1099
1091
DeserializeList (value, len, |value| + LENGTH_LEN + lengthBytes, depth, AttrValueAndLength(AttributeValue.L([]), LENGTH_LEN + lengthBytes))
1100
1092
0 commit comments