interplane.Get Omega
Read in your language

omnet

aien-dev/omnet

Brought by drakestapleton

branch main Branches Tags History

omnet / om / argon2 / test / trap.om

33 lines · 803 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note trap.om: concatenated after blake2b.om, argon2.om and argon2pool.om. Each case breaks one caller
3note contract by one, so the program must exit 103 (trap 3) and never reach ret 0:
4note trap 1 a2tka with sn = 1025 (secret capacity 1024)
5note trap 2 a2hash with |P| = 65537 (one field over 65536)
6note trap 3 a2hash with |P| + |S| + |K| + |X| = 65497 (H0 input capacity 65496)
7fn main to int
8a = new uchar 16 0
9l = argread 1 a 0 16
10if ne l 1
11ret 2
12end
13c = get a 0
14s = new uchar 1024 0
15o = new uchar 32 0
16if eq c 49
17a2tka s 1025 o
18end
19prm = new ulong 8 0
20put prm 0 1
21put prm 1 8
22put prm 2 1
23put prm 3 32
24put prm 4 65537
25if eq c 51
26put prm 4 65481
27put prm 5 16
28end
29inp = new uchar 65536 0
30out = new uchar 1024 0
31e = a2hash prm inp out
32ret int e
33end