@@ -135,37 +135,37 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
135135 print |roundTripTests[1]. configs|, " configs and ", |roundTripTests[1]. records|, " records for round trip. \n";
136136 }
137137
138- var _ :- expect DecryptManifest. Decrypt ("decrypt_dotnet_32.json", keyVectors);
139- var _ :- expect DecryptManifest. Decrypt ("decrypt_java_32.json", keyVectors);
140- var _ :- expect DecryptManifest. Decrypt ("decrypt_dotnet_33.json", keyVectors);
141- var _ :- expect DecryptManifest. Decrypt ("decrypt_java_33.json", keyVectors);
142- var _ :- expect DecryptManifest. Decrypt ("decrypt_dotnet_33a.json", keyVectors);
143- var _ :- expect DecryptManifest. Decrypt ("decrypt_java_33a.json", keyVectors);
144- var _ :- expect DecryptManifest. Decrypt ("decrypt_rust_38.json", keyVectors);
145- var _ :- expect DecryptManifest. Decrypt ("decrypt_go_38.json", keyVectors);
146- var _ :- expect DecryptManifest. Decrypt ("decrypt_java_39.json", keyVectors);
147- var _ :- expect WriteManifest. Write ("encrypt.json");
148- var _ :- expect EncryptManifest. Encrypt ("encrypt.json", "decrypt.json", "java", "3.3", keyVectors);
149- var _ :- expect DecryptManifest. Decrypt ("decrypt.json", keyVectors);
138+ // var _ :- expect DecryptManifest.Decrypt("decrypt_dotnet_32.json", keyVectors);
139+ // var _ :- expect DecryptManifest.Decrypt("decrypt_java_32.json", keyVectors);
140+ // var _ :- expect DecryptManifest.Decrypt("decrypt_dotnet_33.json", keyVectors);
141+ // var _ :- expect DecryptManifest.Decrypt("decrypt_java_33.json", keyVectors);
142+ // var _ :- expect DecryptManifest.Decrypt("decrypt_dotnet_33a.json", keyVectors);
143+ // var _ :- expect DecryptManifest.Decrypt("decrypt_java_33a.json", keyVectors);
144+ // var _ :- expect DecryptManifest.Decrypt("decrypt_rust_38.json", keyVectors);
145+ // var _ :- expect DecryptManifest.Decrypt("decrypt_go_38.json", keyVectors);
146+ // var _ :- expect DecryptManifest.Decrypt("decrypt_java_39.json", keyVectors);
147+ // var _ :- expect WriteManifest.Write("encrypt.json");
148+ // var _ :- expect EncryptManifest.Encrypt("encrypt.json", "decrypt.json", "java", "3.3", keyVectors);
149+ // var _ :- expect DecryptManifest.Decrypt("decrypt.json", keyVectors);
150150 if |globalRecords| + |tableEncryptionConfigs| + |queries| == 0 {
151151 print "\nRunning no tests\n";
152152 return ;
153153 }
154154 Validate ();
155155 StringOrdering ();
156156 BucketTests ();
157- LargeTests ();
158- PerfQueryTests ();
159- BasicIoTest ();
160- RunIoTests ();
161- BasicQueryTest ();
162- ConfigModTest ();
163- ComplexTests ();
164- WriteTests ();
165- RoundTripTests ();
166- DecryptTests ();
167- var client :- expect CreateInterceptedDDBClient. CreateVanillaDDBClient ();
168- DeleteTable (client);
157+ // LargeTests();
158+ // PerfQueryTests();
159+ // BasicIoTest();
160+ // RunIoTests();
161+ // BasicQueryTest();
162+ // ConfigModTest();
163+ // ComplexTests();
164+ // WriteTests();
165+ // RoundTripTests();
166+ // DecryptTests();
167+ // var client :- expect CreateInterceptedDDBClient.CreateVanillaDDBClient();
168+ // DeleteTable(client);
169169 }
170170
171171 function MakeBucketRecord (x : nat ) : DDB. AttributeMap
@@ -175,12 +175,13 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
175175
176176 map [
177177 HashName := DDB. AttributeValue. N (num),
178- "Attr1" := DDB. AttributeValue. S ("AAAA"),
179- "Attr2" := DDB. AttributeValue. S ("BBBB"),
180- "Attr3" := DDB. AttributeValue. S ("CCCC"),
181- "Attr4" := DDB. AttributeValue. S ("DDDD"),
182- "Attr5" := DDB. AttributeValue. S ("EEEE"),
183- "Attr6" := DDB. AttributeValue. S ("FFFF"),
178+ AttrNames[0] := AttrValues[0],
179+ AttrNames[1] := AttrValues[1],
180+ AttrNames[2] := AttrValues[2],
181+ AttrNames[3] := AttrValues[3],
182+ AttrNames[4] := AttrValues[4],
183+ AttrNames[5] := AttrValues[5],
184+ AttrNames[6] := AttrValues[6],
184185 "PreferredBucket" := DDB. AttributeValue. N (num2)
185186 ]
186187 }
@@ -353,7 +354,8 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
353354 ":attr3",
354355 ":attr4",
355356 ":attr5",
356- ":attr6"
357+ ":attr6",
358+ ":attr7"
357359 ]
358360
359361 const AttrNames : seq < DDB. AttributeName> :=
@@ -363,7 +365,8 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
363365 "Attr3",
364366 "Attr4",
365367 "Attr5",
366- "Attr6"
368+ "Attr6",
369+ "Attr7"
367370 ]
368371
369372 const AttrValues : seq < DDB. AttributeValue> :=
@@ -373,7 +376,8 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
373376 DDB. AttributeValue. S ("CCCC"),
374377 DDB. AttributeValue. S ("DDDD"),
375378 DDB. AttributeValue. S ("EEEE"),
376- DDB. AttributeValue. S ("FFFF")
379+ DDB. AttributeValue. S ("FFFF"),
380+ DDB. AttributeValue. S ("GGGG")
377381 ]
378382
379383 function GetBucketScan1 (attr : nat ) : (out : DDB. ScanInput)
@@ -508,6 +512,16 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
508512 }
509513
510514
515+ function GetCompQuery2671 () : DDB. QueryInput
516+ {
517+ DDB. QueryInput (
518+ TableName := TableName,
519+ IndexName := Some("ATTR_INDEX2671"),
520+ FilterExpression := None,
521+ KeyConditionExpression := Some ("Comp2671 = :attr2671 "),
522+ ExpressionAttributeValues := Some (map[":attr2671 " := DDB.AttributeValue.S("2_BBBB.6_FFFF.7_GGGG.1_AAAA")])
523+ )
524+ }
511525
512526 function GetBucketQuery1 () : DDB. QueryInput
513527 {
@@ -633,6 +647,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
633647 method BucketTests ()
634648 {
635649 print "BucketTests\n";
650+ BucketTest4 ();
636651 BucketTest3 ();
637652 BucketTest1 ();
638653 BucketTest2 ();
@@ -671,6 +686,7 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
671686 // 2) Every bucket holds at least one item
672687 method BucketTest1 ()
673688 {
689+ print "BucketTest1\n";
674690 expect "bucket_encrypt" in largeEncryptionConfigs;
675691 var config := largeEncryptionConfigs["bucket_encrypt"];
676692 var wClient, rClient := SetupTestTable (config, config);
@@ -734,9 +750,32 @@ module {:options "-functionSyntax:4"} DdbEncryptionTestVectors {
734750 }
735751 }
736752
753+ // Similar to BucketTest1, but with complex config
754+ method BucketTest4 ()
755+ {
756+ print "BucketTest4\n";
757+ expect "complex_bucket_encrypt" in largeEncryptionConfigs;
758+ var config := largeEncryptionConfigs["complex_bucket_encrypt"];
759+ var wClient, rClient := SetupTestTable (config, config);
760+ for i : nat := 0 to 100 {
761+ var putInput := DDB. PutItemInput (
762+ TableName := TableName,
763+ Item := MakeBucketRecord(i)
764+ );
765+ var _ :- expect wClient. PutItem (putInput);
766+ }
767+ print "BucketTest4 Wrote";
768+ TestBucketQueries (rClient, 2, GetCompQuery2671(), "comp query 2671");
769+ print "BucketTest4 Did One";
770+
771+ // TestBucketScan(rClient, GetBucketScan6(0,1,2,3,4,5));
772+ TestBucketScan (rClient, GetBucketScan6(5,4,3,2,1,0));
773+ }
774+
737775 // As BucketTest1, but with custom bucket selector
738776 method BucketTest2 ()
739777 {
778+ print "BucketTest2\n";
740779 expect "bucket_encrypt" in largeEncryptionConfigs;
741780 var config := largeEncryptionConfigs["bucket_encrypt"];
742781 var testSelector := new TestBucketSelector ();
0 commit comments