interplane.Get Omega
Read in your language

omtls

omtls: a TLS 1.3 client (RFC 8446) written fresh in seeded Omega, for mailhand. Not audited by a cryptographer. Free (Apache-2.0).

Brought by drakestapleton

branch main Branches Tags History

omtls / tests / drv / symbench.om

55 lines · 1417 bytes Raw Blame History
1note omtls benchmark (not a test driver): ot_ae_seal throughput over 1 MiB for ChaCha20-Poly1305 (alg 3) and
2note AES-128-GCM (alg 1), and X25519 (ot_x25_mul) operations per second. Wall time from monons.
3note Output: one line per figure, "bench NAME bytes_or_ops=N reps=R ns=T per_second=P".
4text ot_syb_b "bench "
5text ot_syb_n " n="
6text ot_syb_r " reps="
7text ot_syb_t " ns="
8text ot_syb_p " per_second="
9text ot_syb_cp "chacha20-poly1305-seal-bytes"
10text ot_syb_gc "aes-128-gcm-seal-bytes"
11text ot_syb_x "x25519-ops"
12text ot_syb_nl "\n"
13fn ot_syb_out nm view uchar * n ulong reps ulong ns ulong to void
14ot_sy_put ot_syb_b
15ot_sy_put nm
16ot_sy_put ot_syb_n
17ot_sy_num n
18ot_sy_put ot_syb_r
19ot_sy_num reps
20ot_sy_put ot_syb_t
21ot_sy_num ns
22ot_sy_put ot_syb_p
23ot_sy_num div mul mul n reps 1000 div ns 1000000
24ot_sy_put ot_syb_nl
25end
26fn ot_syb_ae alg ulong buf edit uchar * reps ulong to ulong
27kn = new uchar 44 7
28aad = new uchar 13 1
29t0 = monons
30j = ulong 0
31while lt j reps bound 1000000
32ot_ae_seal alg kn aad buf
33j = add j 1
34end
35ret ulong sub monons t0
36end
37fn main to int
38buf = new uchar 1048592 5
39ns = ot_syb_ae 3 buf 16
40ot_syb_out ot_syb_cp 1048576 16 ns
41ns = ot_syb_ae 1 buf 4
42ot_syb_out ot_syb_gc 1048576 4 ns
43o = new uchar 32 0
44k = new uchar 32 3
45u = new uchar 32 9
46t0 = monons
47j = ulong 0
48while lt j 2000 bound 2001
49ot_x25_mul o k u
50j = add j 1
51end
52ns = ulong sub monons t0
53ot_syb_out ot_syb_x 1 2000 ns
54ret 0
55end