omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / seed / qualification / security673 / relational / evidence / gate1 / 39.src
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note Frozen source set{0,1} independent of secret; universal same-choice coupling. |
| 3 | text ok "PASS L8 finite: inclusion4/4, faulty same-choice pairs2/2 differ, correct pairs2/2 equal\n" |
| 4 | fn allowed s ulong choice ulong to ulong |
| 5 | ret choice |
| 6 | end |
| 7 | fn faulty s ulong choice ulong to ulong |
| 8 | ret choice |
| 9 | end |
| 10 | fn main to int |
| 11 | inc = ulong 0 |
| 12 | bad = ulong 0 |
| 13 | for s ulong 2 |
| 14 | for c ulong 2 |
| 15 | r = faulty s c |
| 16 | if or eq r allowed s 0 eq r allowed s 1 |
| 17 | inc = add inc 1 |
| 18 | end |
| 19 | end |
| 20 | end |
| 21 | for c ulong 2 |
| 22 | if ne allowed 0 c allowed 1 c |
| 23 | ret 81 |
| 24 | end |
| 25 | if ne faulty 0 c faulty 1 c |
| 26 | bad = add bad 1 |
| 27 | end |
| 28 | end |
| 29 | if ne inc 4 |
| 30 | ret 82 |
| 31 | end |
| 32 | if ne bad 2 |
| 33 | ret 83 |
| 34 | end |
| 35 | n = write 1 ok 0 len ok |
| 36 | if ne n long len ok |
| 37 | ret 84 |
| 38 | end |
| 39 | ret 0 |
| 40 | end |