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
| 1 | note omtls AES driver layer: one-block AES-128 / AES-256 encryption (FIPS 197) through the bitsliced CT core. |
| 2 | note is256 false uses key bytes 0..15. The core works on four blocks; lanes 1..3 carry zeros here. |
| 3 | fn ot_aes_enc1 is256 bool k view uchar 32 in view uchar 16 o edit uchar 16 to void |
| 4 | rk = new ulong 240 0 |
| 5 | s = new ulong 64 0 |
| 6 | w = new ulong 64 0 |
| 7 | if is256 |
| 8 | ot_aes_k256 k rk s w |
| 9 | else |
| 10 | ot_aes_k128 k rk s w |
| 11 | end |
| 12 | for i ulong 64 unroll |
| 13 | put s i 0 |
| 14 | end |
| 15 | for i ulong 16 unroll |
| 16 | put s i ulong get in i |
| 17 | end |
| 18 | ot_gcm_enc is256 rk s w |
| 19 | for i ulong 16 unroll |
| 20 | put o i ot_ct_lo8 get s i |
| 21 | end |
| 22 | for i ulong 240 |
| 23 | put rk i 0 |
| 24 | end |
| 25 | ot_gcm_z64 s w |
| 26 | end |