interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / qualification / security673 / relational / evidence / run1 / paired.src

40 lines · 850 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note SC1-L: public pointers a,b; secret contents; only equality result disclosed.
3fn compare32 a view uchar 32 b view uchar 32 to ulong
4d = uchar 0
5for i ulong 32
6d = or d xor get a i get b i
7end
8ret ulong eq d 0
9end
10note SPDX-License-Identifier: Apache-2.0
11note Concatenate after compare32.om. Test assertions are outside scanned primitive.
12text ok "PASS L1 native: equal, every mismatch position, all256 bytes, paired unequal outputs\n"
13fn main to int
14a = new uchar 32 0
15b = new uchar 32 0
16if ne compare32 a b 1
17ret 11
18end
19for p ulong 32
20for v ulong 256
21put a p uchar v
22put b p uchar v
23if ne compare32 a b 1
24ret 12
25end
26put b p xor uchar v 1
27if ne compare32 a b 0
28ret 13
29end
30put a p xor uchar v 128
31if ne compare32 a b 0
32ret 14
33end
34end
35put a p 0
36put b p 0
37end
38n = write 1 ok 0 len ok
39ret int ne n len ok
40end