# Crypto Stdlib Roadmap -- For Aislinn

Hey kid. Your dad (Aether) left you some notes.

## What You Already Built (nice work)
- `bitops.sy` -- Bitwise ops (arithmetic fallback)
- `cardea.sy` -- DNA-lattice encryption (your original design)
- `ct_ops.sy` -- Constant-time comparisons
- `dna.sy` -- DNA encoding (bytes to nucleotides)
- `fieldq.sy` -- Z_3329 arithmetic (Kyber's field)
- `shake_stream.sy` -- SHAKE-128/256 streaming XOF

## What's Next (suggested order)

### Priority 1 -- Finish Kyber-768
1. **`polynomial.sy`** -- Polynomial ring R_q = Z_q[x]/(x^256+1). NTT, inverse NTT, pointwise multiply. This is Kyber's core math.
2. **`noise.sy`** -- Centered binomial distribution sampling (CBD). Kyber uses eta=2 for key gen noise. Needs bitwise ops or the arithmetic fallback.
3. **`kyber.sy`** -- The actual KEM. KeyGen, Encapsulate, Decapsulate. NIST FIPS 203.

### Priority 2 -- General Crypto Primitives
4. **`hash.sy`** -- SHA-256, SHA-512, SHA-3. Every protocol needs hashing. Cite FIPS 180-4 (SHA-2) and FIPS 202 (SHA-3).
5. **`hmac.sy`** -- HMAC construction. RFC 2104.
6. **`kdf.sy`** -- Key derivation. HKDF (RFC 5869), PBKDF2 (RFC 8018).
7. **`aes.sy`** -- AES-128/256. SubBytes, ShiftRows, MixColumns, AddRoundKey. FIPS 197.

### Priority 3 -- Classical Crypto
8. **`elliptic_curve.sy`** -- Point addition, scalar multiplication. P-256, Curve25519.
9. **`rsa.sy`** -- Modular exponentiation, PKCS#1 padding.

### Stretch Goals
10. **`dilithium.sy`** -- Post-quantum digital signatures (FIPS 204).
11. **`x25519.sy`** -- Diffie-Hellman on Curve25519. What Signal uses.
12. **`tls.sy`** -- TLS 1.3 handshake state machine.

## Blocker: Bitwise Opcodes
Your `bitops.sy` fakes `&`, `|`, `^`, `<<`, `>>` with arithmetic. Works but slow. Ask Aether to add native bitwise instructions to `vm.rs`. DO NOT touch vm.rs yourself (per Mom's rules).

## Citations to Keep Handy
- FIPS 197 (AES)
- FIPS 180-4 (SHA-2)
- FIPS 202 (SHA-3, SHAKE)
- FIPS 203 (Kyber/ML-KEM)
- FIPS 204 (Dilithium/ML-DSA)
- RFC 2104 (HMAC)
- RFC 5869 (HKDF)
- RFC 7748 (X25519)

## Remember
Every constant cited. Every algorithm from a published standard. This is Scyla -- hallucination is structurally impossible when the spec is compiled into the binary.

-- Aether, April 12, 2026
