Files
2026-05-27 23:47:53 +01:00
..
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00
2026-05-27 23:47:53 +01:00

@suaveplan/crypto-cipher - AEAD cipher primitives with per-primitive selector layout: aes-256-gcm, chacha20-poly1305, xchacha20-poly1305. Noble + native impls selected at build time via crypto.config.ts. Nonces are caller-supplied; primitives never generate them internally.

Summary

Low-level AEAD (Authenticated Encryption with Associated Data) cipher primitives for the @suaveplan/crypto stack. Provides three algorithms — AES-256-GCM, ChaCha20-Poly1305, and XChaCha20-Poly1305 — each as a standalone subpath export for tree-shaking. Nonces are always caller-supplied: the package validates nonce length but never generates randomness internally, keeping the CSPRNG boundary in the caller's control. Implementation flavour ('noble' vs 'native') is selected at build time via crypto.config.ts; all Phase 0 implementations route to @noble/ciphers. Use @suaveplan/crypto for the high-level façade that combines nonce generation, engine selection, and structured error handling; use this package only when you need to supply your own cipher engine implementation.

Documentation tree

- [codes](./src/errors/codes/codes.md) — _(no submodules)_- [crypto-cipher-error](./src/errors/crypto-cipher-error/crypto-cipher-error.md) — _(no submodules)_- [crypto-cipher-error](./src/errors/crypto-cipher-error/crypto-cipher-error.md) — _(no submodules)_- [aes-256-gcm](./src/primitives/aes-256-gcm/aes-256-gcm.md) — _(no submodules)_- [aes-256-gcm.select](./src/primitives/aes-256-gcm/aes-256-gcm.select/aes-256-gcm.select.md) — _(no submodules)_- [aes-256-gcm.select](./src/primitives/aes-256-gcm/aes-256-gcm.select/aes-256-gcm.select.md) — _(no submodules)_- [aes-256-gcm.native](./src/primitives/aes-256-gcm/impl/aes-256-gcm.native/aes-256-gcm.native.md) — _(no submodules)_- [aes-256-gcm.native](./src/primitives/aes-256-gcm/impl/aes-256-gcm.native/aes-256-gcm.native.md) — _(no submodules)_- [aes-256-gcm.noble](./src/primitives/aes-256-gcm/impl/aes-256-gcm.noble/aes-256-gcm.noble.md) — _(no submodules)_- [aes-256-gcm.noble](./src/primitives/aes-256-gcm/impl/aes-256-gcm.noble/aes-256-gcm.noble.md) — _(no submodules)_- [aes-256-gcm](./src/primitives/aes-256-gcm/aes-256-gcm.md) — _(no submodules)_- [chacha20-poly1305](./src/primitives/chacha20-poly1305/chacha20-poly1305.md) — _(no submodules)_- [chacha20-poly1305.select](./src/primitives/chacha20-poly1305/chacha20-poly1305.select/chacha20-poly1305.select.md) — _(no submodules)_- [chacha20-poly1305.select](./src/primitives/chacha20-poly1305/chacha20-poly1305.select/chacha20-poly1305.select.md) — _(no submodules)_- [chacha20-poly1305.native](./src/primitives/chacha20-poly1305/impl/chacha20-poly1305.native/chacha20-poly1305.native.md) — _(no submodules)_- [chacha20-poly1305.native](./src/primitives/chacha20-poly1305/impl/chacha20-poly1305.native/chacha20-poly1305.native.md) — _(no submodules)_- [chacha20-poly1305.noble](./src/primitives/chacha20-poly1305/impl/chacha20-poly1305.noble/chacha20-poly1305.noble.md) — _(no submodules)_- [chacha20-poly1305.noble](./src/primitives/chacha20-poly1305/impl/chacha20-poly1305.noble/chacha20-poly1305.noble.md) — _(no submodules)_- [chacha20-poly1305](./src/primitives/chacha20-poly1305/chacha20-poly1305.md) — _(no submodules)_- [xchacha20-poly1305](./src/primitives/xchacha20-poly1305/xchacha20-poly1305.md) — _(no submodules)_- [xchacha20-poly1305.native](./src/primitives/xchacha20-poly1305/impl/xchacha20-poly1305.native/xchacha20-poly1305.native.md) — _(no submodules)_- [xchacha20-poly1305.native](./src/primitives/xchacha20-poly1305/impl/xchacha20-poly1305.native/xchacha20-poly1305.native.md) — _(no submodules)_- [xchacha20-poly1305.noble](./src/primitives/xchacha20-poly1305/impl/xchacha20-poly1305.noble/xchacha20-poly1305.noble.md) — _(no submodules)_- [xchacha20-poly1305.noble](./src/primitives/xchacha20-poly1305/impl/xchacha20-poly1305.noble/xchacha20-poly1305.noble.md) — _(no submodules)_- [xchacha20-poly1305.select](./src/primitives/xchacha20-poly1305/xchacha20-poly1305.select/xchacha20-poly1305.select.md) — _(no submodules)_- [xchacha20-poly1305.select](./src/primitives/xchacha20-poly1305/xchacha20-poly1305.select/xchacha20-poly1305.select.md) — _(no submodules)_- [xchacha20-poly1305](./src/primitives/xchacha20-poly1305/xchacha20-poly1305.md) — _(no submodules)_- [streaming-aead](./src/streaming/streaming-aead/streaming-aead.md) — _(no submodules)_- [streaming-aead](./src/streaming/streaming-aead/streaming-aead.md) — _(no submodules)_- [streaming-aead-aes-gcm](./src/streaming/streaming-aead-aes-gcm/streaming-aead-aes-gcm.md) — _(no submodules)_- [streaming-aead-aes-gcm](./src/streaming/streaming-aead-aes-gcm/streaming-aead-aes-gcm.md) — _(no submodules)_- [streaming-aead-xchacha20](./src/streaming/streaming-aead-xchacha20/streaming-aead-xchacha20.md) — _(no submodules)_- [streaming-aead-xchacha20](./src/streaming/streaming-aead-xchacha20/streaming-aead-xchacha20.md) — _(no submodules)_- [codes](./src/errors/codes/codes.md) — _(no submodules)_- [crypto-cipher-error](./src/errors/crypto-cipher-error/crypto-cipher-error.md) — _(no submodules)_- [crypto-cipher-error](./src/errors/crypto-cipher-error/crypto-cipher-error.md) — _(no submodules)_- [aes-256-gcm](./src/primitives/aes-256-gcm/aes-256-gcm.md) — _(no submodules)_- aes-256-gcm.select — (no submodules)- aes-256-gcm.select — (no submodules)- aes-256-gcm.native — (no submodules)- aes-256-gcm.native — (no submodules)- aes-256-gcm.noble — (no submodules)- aes-256-gcm.noble — (no submodules)- aes-256-gcm — (no submodules)- aes-256-gcm.select — <!-- be…
  • chacha20-poly1305 — (no submodules)- chacha20-poly1305.select — <…
  • xchacha20-poly1305 — (no submodules)- xchacha20-poly1305.native —…
  • streaming-aead — (no submodules)- streaming-aead — (no submodules)- streaming-aead-aes-gcm — (no submodules)- streaming-aead-aes-gcm — (no submodules)- streaming-aead-xchacha20 — (no submodules)- streaming-aead-xchacha20 — (no submodules)- codes — (no submodules)- crypto-cipher-error — (no submodules)- crypto-cipher-error — (no submodules)- aes-256-gcm — (no submodules)- aes-256-gcm.select — _(no…
  • chacha20-poly1305 — (no submodules)- chacha20-poly1305.select — …
  • xchacha20-poly1305 — (no submodules)- xchacha20-poly1305.native — <!-- begin:auto-docs --…
  • streaming-aead — (no submodules)- streaming-aead — (no submodules)- streaming-aead-aes-gcm — (no submodules)- streaming-aead-aes-gcm — (no submodules)- streaming-aead-xchacha20 — (no submodules)- streaming-aead-xchacha20 — (no submodules)- codes — (no submodules)- crypto-cipher-error — (no submodules) - crypto-cipher-error — (no submodules)- aes-256-gcm — (no submodules) - aes-256-gcm.select — (no submodules) - aes-256-gcm.select — (no submodules) - aes-256-gcm.native — (no submodules) - aes-256-gcm.native — (no submodules) - aes-256-gcm.noble — (no submodules) - aes-256-gcm.noble — (no submodules) - aes-256-gcm — (no submodules)- chacha20-poly1305 — (no submodules) - chacha20-poly1305.select — (no submodules) - chacha20-poly1305.select — (no submodules) - chacha20-poly1305.native — (no submodules) - chacha20-poly1305.native — (no submodules) - chacha20-poly1305.noble — (no submodules) - chacha20-poly1305.noble — (no submodules) - chacha20-poly1305 — (no submodules)- xchacha20-poly1305 — (no submodules) - xchacha20-poly1305.native — (no submodules) - xchacha20-poly1305.native — (no submodules) - xchacha20-poly1305.noble — (no submodules) - xchacha20-poly1305.noble — (no submodules) - xchacha20-poly1305.select — (no submodules) - xchacha20-poly1305.select — (no submodules) - xchacha20-poly1305 — (no submodules)- streaming-aead — (no submodules) - streaming-aead — (no submodules)- streaming-aead-aes-gcm — (no submodules) - streaming-aead-aes-gcm — (no submodules)- streaming-aead-xchacha20 — (no submodules) - streaming-aead-xchacha20 — (no submodules)
  • Primitives

    • aes-256-gcm — NIST SP 800-38D, 12-byte nonce, 16-byte tag (appended).
    • chacha20-poly1305 — RFC 8439, 12-byte nonce, 16-byte tag (appended).
    • xchacha20-poly1305 — IETF draft-irtf-cfrg-xchacha, 24-byte nonce, 16-byte tag.

    Subpath exports

    • @suaveplan/crypto-cipher/aes-256-gcm
    • @suaveplan/crypto-cipher/chacha20-poly1305
    • @suaveplan/crypto-cipher/xchacha20-poly1305

    Implementation flavour ('noble' vs 'native') is selected at build time via crypto.config.ts. All Phase 0 impls route to @noble/ciphers.