You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: export extra AEAD modes (XChaCha20-Poly1305, XAES-256-GCM, AES-SIV, AES-CCM, AES-EAX, AES-OCB3) over the C FFI #150
Export extra AEAD modes (XChaCha20-Poly1305, XAES-256-GCM, AES-SIV, AES-CCM, AES-EAX, AES-OCB3) from cas-lib over cas-core-lib's C ABI, so cas-dotnet-sdk can bind it.
cas-lib: Cryptographic-API-Services/cas-lib#155 (AEAD modes: XChaCha20-Poly1305, AES-SIV, AES-CCM, AES-EAX, AES-OCB3, XAES-256-GCM). Not implemented in cas-lib yet; this issue tracks exposing it once it ships.
API shape in cas-lib: Each mode is a CASAeadSeal impl in cas-lib: expose generate_key, seal(key, plaintext, aad?) and open(key, sealed, aad?) (output nonce || ciphertext || tag). Only expose caller-supplied-nonce functions if cas-lib adds them.
Scope
XChaCha20-Poly1305
XAES-256-GCM
AES-128-SIV / AES-256-SIV
AES-CCM (tag/nonce sizes as cas-lib picks)
AES-EAX
AES-OCB3
Feature-specific notes
Document that AES-SIV is deterministic (equal plaintexts under the same key and AAD give equal ciphertexts).
Tests
Run the same vectors cas-lib uses through this repo's harness: Wycheproof xchacha20_poly1305_test.json, aes_siv_cmac_test.json, aead_aes_siv_cmac_test.json, aes_ccm_test.json, aes_eax_test.json; RFC 7253 (OCB3) and C2SP XAES-256-GCM vectors.
Implementation notes (cas-core-lib FFI conventions, see CLAUDE.md)
#[no_mangle] pub extern "C" functions; bytes cross as pointer + usize length, never slices or Vecs.
Results are #[repr(C)] structs in the module's types.rs with an error_code; buffers are handed out with export_bytes (never as_mut_ptr + forget), strings with CString::into_raw.
Result structs that hold more than one buffer get a free_<struct> and a row in the CLAUDE.md "Ownership of returned memory" table; every new struct gets the ownership rustdoc (csbindgen copies it into the C# bindings).
Activity