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 / om2 / sec / s5s7 / l5-shactx.om

39 lines · 1031 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note contract 5 layout lines 153-165: the SHA context layout of lines 163-164 as corrected by erratum E5
3note (count is a scalar field: COUNT omitted). A 104-byte
4note uchar array is passed as `c edit shactx`, every field is set with put, the bytes are written to
5note stdout, then count and state[7] are read back with get (exit 90/91 on mismatch).
6note stdout = oracle exp/l5-shactx.out (python3 struct; gcc offsetof oracle/s5s7/offsetof.c agrees).
7om2
8layout shactx 104
9field state uint 8 at 0 little
10field count ulong at 32 little
11field buf uchar 64 at 40 little
12end
13fn fill c edit shactx to void
14for i ulong 8
15put c state i add 0x10203040 uint i
16end
17put c count 0x0123456789abcdef
18for j ulong 64
19put c buf j uchar add mul j 3 1
20end
21end
22fn cnt c view shactx to ulong
23ret get c count
24end
25fn st7 c view shactx to uint
26ret get c state 7
27end
28fn main to int
29c = new uchar 104 0
30fill c
31w = write 1 c 0 104
32if ne cnt c 0x0123456789abcdef
33ret 90
34end
35if ne st7 c 0x10203047
36ret 91
37end
38ret 0
39end