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