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 / om / tls / test / acvp / acvpmain.om

50 lines · 923 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note acvpmain.om: main for the ACVP drivers; composed last, after acvpio.om and the driver's drrec.
3note Reads stdin (at most 16 MiB), answers every record line, skips "#" comments and blank lines.
4note Exit 0 when every record was well-formed, 1 when any was malformed or there were none, 2 when
5note stdin cannot be read or exceeds 16 MiB.
6
7fn main to int
8a = new uchar 1048576 0
9b = new uchar 1048576 0
10c = new uchar 1048576 0
11if ne drslurp 0
12r = write 2 tio 0 len tio
13ret 2
14end
15put st 1 0
16while lt get st 1 get st 0 bound 999999
17put st 2 add get st 2 1
18put st 3 0
19put st 4 get st 1
20put st 8 0
21p = drpeek
22if eq p 35
23drskip
24else
25if eq p 10
26dradv
27else
28put st 5 add get st 5 1
29drrec a b c
30if isbad
31put st 6 add get st 6 1
32obyte 32
33for i ulong len tbad
34obyte ulong get tbad i
35end
36drskip
37end
38obyte 10
39end
40end
41end
42oflush
43if ne get st 6 0
44ret 1
45end
46if eq get st 5 0
47ret 1
48end
49ret 0
50end