Skip to content

Commit

Permalink
Add example showing declassify needs more authority
Browse files Browse the repository at this point in the history
  • Loading branch information
cacay committed Feb 14, 2022
1 parent cf67978 commit 34b043d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions examples/inputs/synchronization/Declassify-alice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42
1 change: 1 addition & 0 deletions examples/inputs/synchronization/Declassify-bob.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
43
1 change: 1 addition & 0 deletions examples/outputs/synchronization/Declassify-alice.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
false
Empty file.
15 changes: 15 additions & 0 deletions examples/src/main/viaduct/synchronization/Declassify.via
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
host alice : {A & B}
host bob : {B}

fun main() {
let $pick = input int from alice;

let $guess = input int from bob;
let $trusted_guess = endorse $guess from {B};

let $revealed_pick@Replication(hosts = {alice, bob}) = declassify $pick to {A ⊓ B};
let $bob_wins = $revealed_pick == $trusted_guess;

output $bob_wins to alice;
/* output $bob_wins to bob; */
}

0 comments on commit 34b043d

Please sign in to comment.