Skip to content

Adaptive crypto#15

Merged
jolynch merged 4 commits into
mainfrom
adaptive-crypto
Apr 5, 2026
Merged

Adaptive crypto#15
jolynch merged 4 commits into
mainfrom
adaptive-crypto

Conversation

@jolynch

@jolynch jolynch commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Summary

This patch does two things: it migrates FTCP encryption from the old mixed age/AES scheme to a single self-describing (low/no allocation) internal AEAD transport, and it cleans up a few concurrency issues in the CLI surfaced by race detection.

On the wire, authenticated sessions now negotiate aes or chacha20 explicitly, auto resolves from the server hint, and the chosen cipher applies symmetrically to both request and response payloads. That removes the old half-close/EOF coupling from age, drops per-frame enc= metadata, simplifies frame parsing, and updates the CLI/docs/bench tooling to match. The patch also adds the new AEAD implementation and tests/benchmarks, lowers default server IO depth to 4, lowers the default client request window to 512 MiB, improves server key loading/generation behavior, and fixes CLI progress/reporting races while pruning some dead helper code.

Benchmarks

Measured on linux/amd64 (AMD Ryzen AI 9 HX 370).

Benchmark AES-GCM ChaCha20-Poly1305 age
EncryptLarge 5427.36 MB/s 2666.29 MB/s n/a
DecryptLarge 5306.10 MB/s 2538.36 MB/s n/a
Encrypt 10 MiB 4744 MiB/s 2373 MiB/s 2450 MiB/s
Decrypt 10 MiB 4865 MiB/s 2497 MiB/s 1955 MiB/s

jolynch added 2 commits April 4, 2026 14:47
Since our chunking format is self describing we don't need half close
hacks like age does where it reads beyond the stream. Now the client no
longer needs to close the connection and if we wanted to pipeline
commands from the client in the future we could.
We are basically reading ahead so the pipe can be kept full as much as
possible, instead of relying on fadvise to do the right thing we are
explicitly requesting the pages enter page cache.
@jolynch
jolynch force-pushed the adaptive-crypto branch 2 times, most recently from ed798b6 to 9769caf Compare April 5, 2026 02:07
@jolynch
jolynch merged commit ff9368f into main Apr 5, 2026
1 check passed
@jolynch
jolynch deleted the adaptive-crypto branch April 5, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant