Skip to content

Commit fd33688

Browse files
committed
m
1 parent 5d043c7 commit fd33688

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/src/DDBSupport.dfy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ module DynamoDBSupport {
307307
return Success(req);
308308
} else {
309309
var keyId :- Filter.GetBeaconKeyId(search.value.curr(), req.KeyConditionExpression, req.FilterExpression, req.ExpressionAttributeValues, req.ExpressionAttributeNames);
310-
311310
var foo :- ExtractBucket(search.value.curr(), req.FilterExpression, req.KeyConditionExpression, req.ExpressionAttributeNames, req.ExpressionAttributeValues, actions);
312311
var (newValues, bucket) := foo;
313312
var numQueries :- Filter.GetNumQueries(actions, req.KeyConditionExpression, req.ExpressionAttributeNames, search.value.curr());

DynamoDbEncryption/dafny/DynamoDbEncryption/src/FilterExpr.dfy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1999,7 +1999,7 @@ module DynamoDBFilterExpr {
19991999

20002000
// return the number of queries necessary for these encrypted attributes
20012001
method GetNumQueriesForAttrs(attrs : seq<string>, b : SI.BeaconVersion) returns (output : Result<BucketCount, Error>)
2002-
ensures output.Success? ==> 0 < output.value
2002+
ensures output.Success? ==> output.value <= b.numBuckets
20032003
{
20042004
if |attrs| == 0 {
20052005
return Success(1);
@@ -2031,6 +2031,7 @@ module DynamoDBFilterExpr {
20312031
b : SI.BeaconVersion
20322032
)
20332033
returns (output : Result<BucketCount, Error>)
2034+
ensures output.Success? ==> output.value <= b.numBuckets
20342035
{
20352036
if expr.None? {
20362037
return Success(1);

DynamoDbEncryption/dafny/DynamoDbEncryption/src/SearchInfo.dfy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,13 @@ module SearchableEncryptionInfo {
545545
| Compound(cmp : CompoundBeacon.ValidCompoundBeacon)
546546
{
547547
function method getNumQueries(globalMax : BucketCount) : BucketCount
548+
ensures 0 <= getNumQueries(globalMax) <= globalMax
548549
{
549550
if Standard? then
550-
std.numberOfBuckets
551+
if std.numberOfBuckets <= globalMax then
552+
std.numberOfBuckets
553+
else
554+
globalMax
551555
else
552556
cmp.getNumQueries(globalMax)
553557
}

0 commit comments

Comments
 (0)