Repository navigation
Backlog
Labels
enhancementNew feature or request
Description
Summary
cas-lib's AEADs are AES-GCM, AES-GCM-SIV, ChaCha20-Poly1305 and Ascon-AEAD128. RustCrypto's AEADs workspace has several more standard modes. The most useful for cas-lib consumers are the extended-nonce variants (XChaCha20-Poly1305 and XAES-256-GCM), whose 192-bit nonces are safe to draw at random for any number of messages, and AES-SIV, which is deterministic and nonce-misuse resistant (also a common key-wrap construction). AES-CCM, AES-EAX and AES-OCB3 cover interop with IoT, TLS, Bluetooth and other protocols that require them.
Upstream
- chacha20poly1305 (XChaCha20Poly1305, already a dependency) — https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305
- xaes-256-gcm 0.1 — https://github.com/RustCrypto/AEADs/tree/master/xaes-256-gcm
- aes-siv 0.8 — https://github.com/RustCrypto/AEADs/tree/master/aes-siv
- ccm 0.6 — https://github.com/RustCrypto/AEADs/tree/master/ccm
- eax 0.6 — https://github.com/RustCrypto/AEADs/tree/master/eax
- ocb3 0.2 — https://github.com/RustCrypto/AEADs/tree/master/ocb3
Scope
- XChaCha20-Poly1305
- XAES-256-GCM
- AES-SIV (AES-128-SIV / AES-256-SIV, RFC 5297)
- AES-CCM (RFC 3610; pick the tag/nonce sizes to expose, e.g. 16-byte tag / 13-byte nonce, and document them)
- AES-EAX
- AES-OCB3 (RFC 7253)
Implementation notes
- Follow the module pattern: trait in
cas_<module>.rs, impl in<algorithm>.rs, declared insrc/lib.rs(no top-level re-exports). - Return
CasResult<T>and never panic (a panic across the FFI boundary is UB); addCasErrorvariants only by appending (stable ABI codes). - Zeroize intermediate secret buffers with
zeroize::Zeroizing; structs holding secrets get a redactingDebugimpl (seesrc/pqc/cas_pqc.rs). - Each mode gets a unit struct in
src/symmetric/implementingCASAeadSeal(nonce drawn internally viaOsRng, outputnonce || ciphertext || tag, optional AAD). Reusesrc/symmetric/aead_helpers.rs. - Only add the caller-supplied-nonce
encrypt_plaintext/*_with_aadfunctions if there is an interop need; if added, document the nonce-reuse risk like the existing ones. - AES-SIV: document that it is deterministic (equal plaintexts under the same key and AAD give equal ciphertexts) and that a random nonce is still recommended.
- AES-SIV uses
cmac0.8, which is ondigest0.11: blocked by Move the hash/MAC/PBKDF2 dependencies to the digest 0.11 ecosystem #154 for that item.
Tests
- Wycheproof (add to
tests/wycheproof.rs):xchacha20_poly1305_test.json,aes_siv_cmac_test.json,aead_aes_siv_cmac_test.json,aes_ccm_test.json,aes_eax_test.json. - RFC test vectors for OCB3 (RFC 7253 Appendix A) and XAES-256-GCM (C2SP spec) under
tests/data/. - Seal/open round-trip and tamper tests like the existing AEADs.
Docs
- Add a complete, runnable
fn main()example for each new API todocs/EXAMPLES.mdand keep its Table of Contents in sync.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
WingZer0o commentedon Nov 27, 2026
Downstream tracking issues: