@@ -248,6 +248,9 @@ module {:options "-functionSyntax:4"} WriteManifest {
248
248
[0, 0, 0, 0, 0, 0]
249
249
}
250
250
251
+ // To be consistent :
252
+ // 1) The primary key (actions[0]) must be sign_only or sign_and_include
253
+ // 2) If anything is sign_and_include, then The primary key must be sign_and_include
251
254
predicate IsConsistent (actions : CryptoActions )
252
255
{
253
256
if actions[0] in [DoNothing, Encrypt] then
@@ -258,6 +261,9 @@ module {:options "-functionSyntax:4"} WriteManifest {
258
261
true
259
262
}
260
263
264
+ // For a new config to be consistent with an old config:
265
+ // 1) both configs must be individually consistent
266
+ // 2) they must agree on which fields are do_nothing
261
267
predicate IsConsistentWith (oldActions : CryptoActions , newActions : CryptoActions )
262
268
{
263
269
if ! IsConsistent (oldActions) || ! IsConsistent (newActions) then
@@ -267,6 +273,8 @@ module {:options "-functionSyntax:4"} WriteManifest {
267
273
}
268
274
269
275
// make a test for every valid combination of Crypto Actions
276
+ // 'actions' holds the crypto actions for each of six attributes
277
+ // the loop iterates through all possible combinations of attributes by incrementing this list
270
278
method MakeConfigTests () returns (output : seq < (string , JSON)> )
271
279
{
272
280
var actions : CryptoActions := [0,0,0,0,0,0];
@@ -289,6 +297,9 @@ module {:options "-functionSyntax:4"} WriteManifest {
289
297
290
298
// for a subset of these,
291
299
// make a test to decrypt with every possible valid combination of Crypto Actions
300
+ // testing all of them would take too much time and space,
301
+ // so we select a sample to produce about 2000 more tests
302
+ // every 100th seems as good as any other method to get a representative sample
292
303
if (actionWrittenOuter % 100) == 0 {
293
304
var otherActions : CryptoActions := [0,0,0,0,0,0];
294
305
// 4096 == 4 ^ 6 == size of all possible values of `otherActions`
0 commit comments