Skip to content

Commit 9130859

Browse files
committed
m
1 parent ab174cb commit 9130859

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/src/ConfigToInfo.dfy

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,13 @@ module SearchConfigToInfo {
315315
return Failure(E("A beacon key field name of " + name + " was configured, but there's also a virtual field of that name."));
316316
}
317317
}
318-
var numBuckets : nat := config.numberOfBuckets.UnwrapOr(1) as nat;
319-
:- Need(0 < numBuckets < INT32_MAX_LIMIT, E("Invalid number of buckets specified"));
318+
319+
var numBuckets : int := config.numberOfBuckets.UnwrapOr(1) as int;
320+
:- Need(0 <= numBuckets < INT32_MAX_LIMIT, E("Invalid number of buckets specified, " + Base10Int2String(numBuckets) + ", must be 0 < numberOfBuckets <= 255."));
321+
// Zero is invalid, but in Java we can't distinguish None from Some(0)
322+
if numBuckets == 0 {
323+
numBuckets := 1;
324+
}
320325
return I.MakeBeaconVersion(
321326
config.version as I.VersionNumber,
322327
source,

0 commit comments

Comments
 (0)