@@ -403,31 +403,31 @@ module SearchConfigToInfo {
403
403
Some (badSeq[0])
404
404
}
405
405
406
- function method IsValidTwin (converted : I .BeaconMap, name : string , length : B .BeaconLength, twin : string )
406
+ function method IsValidShare (converted : I .BeaconMap, name : string , length : B .BeaconLength, share : string )
407
407
: (ret : Result< bool , Error> )
408
408
ensures ret. Success? ==>
409
- && twin in converted
410
- && converted[twin ]. Standard?
411
- && converted[twin ]. std. length == length
409
+ && share in converted
410
+ && converted[share ]. Standard?
411
+ && converted[share ]. std. length == length
412
412
{
413
- if twin in converted then
414
- var tb := converted[twin ];
413
+ if share in converted then
414
+ var tb := converted[share ];
415
415
if tb. Standard? then
416
- if tb. std. twin . Some? then
417
- if name == twin then
418
- Failure (E("Beacon " + name + " is twinned to itself."))
416
+ if tb. std. share . Some? then
417
+ if name == share then
418
+ Failure (E("Beacon " + name + " is shared to itself."))
419
419
else
420
- Failure (E("Beacon " + name + " is twinned to " + twin + " which is in turn twinned to " + tb.std.twin .value
421
- + ". Twin chains are not allowed."))
420
+ Failure (E("Beacon " + name + " is shared to " + share + " which is in turn shared to " + tb.std.share .value
421
+ + ". Share chains are not allowed."))
422
422
else if tb. std. length == length then
423
423
Success (true)
424
424
else
425
- Failure (E("Beacon " + name + " is twinned to " + twin + " but " + name + " has length " + Base10Int2String(length as int)
426
- + " and " + twin + " has length " + Base10Int2String (tb.std.length as int) + ". "))
425
+ Failure (E("Beacon " + name + " is shared to " + share + " but " + name + " has length " + Base10Int2String(length as int)
426
+ + " and " + share + " has length " + Base10Int2String (tb.std.length as int) + ". "))
427
427
else
428
- Failure (E("Beacon " + name + " is twinned to " + twin + " but " + twin + " is a compound beacon."))
428
+ Failure (E("Beacon " + name + " is shared to " + share + " but " + share + " is a compound beacon."))
429
429
else
430
- Failure (E("Beacon " + name + " is twinned to " + twin + " which is not defined."))
430
+ Failure (E("Beacon " + name + " is shared to " + share + " which is not defined."))
431
431
}
432
432
433
433
// convert configured StandardBeacons to internal Beacons
@@ -482,20 +482,20 @@ module SearchConfigToInfo {
482
482
var locString := GetLocStr (beacons[0].name, beacons[0].loc);
483
483
var isPartOnly := false ;
484
484
var isAsSet := false ;
485
- var twin : Option< string > := None;
485
+ var share : Option< string > := None;
486
486
if beacons[0]. style. Some? {
487
487
match beacons[0]. style. value {
488
488
case partOnly (t) => isPartOnly := true ;
489
- case twinned (t) => twin := Some (t.other);
489
+ case shared (t) => share := Some (t.other);
490
490
case asSet (t) => isAsSet := true ;
491
- // = specification/searchable-encryption/beacons.md#twinnedset -initialization
492
- // # A TwinnedSet Beacon MUST behave both as [Twinned ](#twinned -initialization) and [AsSet](#asset-initialization).
493
- case twinnedSet (t) => twin := Some (t.other); isAsSet := true ;
491
+ // = specification/searchable-encryption/beacons.md#sharedset -initialization
492
+ // # A SharedSet Beacon MUST behave both as [Shared ](#shared -initialization) and [AsSet](#asset-initialization).
493
+ case sharedSet (t) => share := Some (t.other); isAsSet := true ;
494
494
}
495
495
496
496
}
497
497
var newBeacon :- B. MakeStandardBeacon (client, beacons[0].name, beacons[0].length as B.BeaconLength, locString,
498
- isPartOnly, isAsSet, twin );
498
+ isPartOnly, isAsSet, share );
499
499
500
500
// = specification/searchable-encryption/search-config.md#beacon-version-initialization
501
501
// # Initialization MUST fail if the [terminal location](virtual.md#terminal-location)
@@ -1070,27 +1070,28 @@ module SearchConfigToInfo {
1070
1070
// # Initialization MUST fail if the configuration does not use a PartOnly in a [compound beacon](#compound-beacon).
1071
1071
ensures |names| != 0 && I. IsPartOnly (data[names[0]]) && ! ExistsInCompound (allNames, names[0], data) ==> ret. Failure?
1072
1072
1073
- ensures ret. Success? && 0 < |names| && data[names[0]]. Standard? && data[names[0]]. std. twin . Some? ==>
1074
- && var twin := data[names[0]]. std. twin . value;
1075
- && IsValidTwin (data, names[0], data[names[0]].std.length, twin ). Success?
1076
- // = specification/searchable-encryption/beacons.md#twinned -initialization
1073
+ ensures ret. Success? && 0 < |names| && data[names[0]]. Standard? && data[names[0]]. std. share . Some? ==>
1074
+ && var share := data[names[0]]. std. share . value;
1075
+ && IsValidShare (data, names[0], data[names[0]].std.length, share ). Success?
1076
+ // = specification/searchable-encryption/beacons.md#shared -initialization
1077
1077
// = type=implication
1078
1078
// # This name MUST be the name of a previously defined Standard Beacon.
1079
- && twin in data
1080
- && data[twin ]. Standard?
1081
- // = specification/searchable-encryption/beacons.md#twinned -initialization
1079
+ && share in data
1080
+ && data[share ]. Standard?
1081
+ // = specification/searchable-encryption/beacons.md#shared -initialization
1082
1082
// = type=implication
1083
1083
// # This beacon's [length](#beacon-length) MUST be equal to the `other` beacon's [length](#beacon-length).
1084
- && data[twin ]. std. length == data[names[0]]. std. length
1084
+ && data[share ]. std. length == data[names[0]]. std. length
1085
1085
{
1086
1086
if |names| == 0 then
1087
1087
Success (true)
1088
1088
else
1089
1089
var b := data[names[0]];
1090
1090
if I. IsPartOnly (b) && ! ExistsInCompound (allNames, names[0], data) then
1091
1091
Failure (E("PartOnly beacon " + names[0] + " MUST be used in a compound beacon."))
1092
- else if b. Standard? && b. std. twin. Some? then
1093
- IsValidTwin (data, names[0], b.std.length, b.std.twin.value)
1092
+ else if b. Standard? && b. std. share. Some? then
1093
+ var _ :- IsValidShare (data, names[0], b.std.length, b.std.share.value);
1094
+ CheckAllBeacons (names[1..], allNames, data)
1094
1095
else
1095
1096
CheckAllBeacons (names[1..], allNames, data)
1096
1097
}
0 commit comments