Skip to main content

Crate oxicrypto_aead

Crate oxicrypto_aead 

Source
Expand description

Pure Rust AEAD implementations for the OxiCrypto stack.

AlgorithmModuleKey / Nonce
AES-128-GCM(inline)16 / 12 bytes
AES-256-GCM(inline)32 / 12 bytes
ChaCha20-Poly1305(inline)32 / 12 bytes
AES-128-GCM-SIVaes_gcm_siv16 / 12 bytes
AES-256-GCM-SIVaes_gcm_siv32 / 12 bytes
XChaCha20-Poly1305xchacha2032 / 24 bytes
AES-128-CCMccm16 / 13 bytes
AES-256-CCMccm32 / 13 bytes
AES-128-OCB3ocb3_impl16 / 12 bytes
AES-256-OCB3ocb3_impl32 / 12 bytes
Deoxys-II-128-128deoxys16 / 16 bytes

§Streaming AEAD (STREAM construction)

stream::Aes256GcmStream and stream::ChaCha20Poly1305Stream implement the StreamingAead trait using the STREAM chunked construction (Hoang-Reyhanitabar-Rogaway-Vizár 2015).

§Nonce sequences

nonce_seq::Nonce12 and nonce_seq::Nonce24 provide monotonic nonce generators suitable for AES-GCM / XChaCha20 respectively.

§Key Wrap (RFC 3394)

keywrap provides AES-128-KW and AES-256-KW for wrapping key material. This is a standalone API that does not implement the Aead trait.

§SealedBox

sealed_box provides seal_box / open_box helpers that prepend a randomly-generated nonce to the ciphertext as a single opaque blob.

§Random-nonce helper

seal_with_random_nonce encrypts plaintext with an on-the-fly random nonce and returns (nonce, ciphertext_with_tag) separately.

Re-exports§

pub use aes_gcm_siv::AesGcmSiv128;
pub use aes_gcm_siv::AesGcmSiv256;
pub use ccm::Aes128Ccm;
pub use ccm::Aes256Ccm;
pub use deoxys::Deoxys2_128;
pub use keywrap::aes128_key_unwrap;
pub use keywrap::aes128_key_wrap;
pub use keywrap::aes256_key_unwrap;
pub use keywrap::aes256_key_wrap;
pub use nonce_seq::Nonce12;
pub use nonce_seq::Nonce24;
pub use nonce_seq::NonceSequence;
pub use ocb3_impl::Aes128Ocb3;
pub use ocb3_impl::Aes256Ocb3;
pub use sealed_box::open_box;
pub use sealed_box::seal_box;
pub use stream::Aes256GcmStream;
pub use stream::ChaCha20Poly1305Stream;
pub use xchacha20::XChaCha20Poly1305;

Modules§

aes_gcm_siv
AES-GCM-SIV authenticated encryption for the OxiCrypto stack.
ccm
AES-CCM authenticated encryption (RFC 3610).
deoxys
Deoxys-II-128-128 authenticated encryption (SCT-2 mode).
keywrap
AES Key Wrap (RFC 3394 / NIST SP 800-38F).
nonce_seq
Monotonic nonce sequence generator.
ocb3_impl
AES-OCB3 authenticated encryption (RFC 7253).
sealed_box
SealedBox — nonce-prefixed AEAD ciphertext format.
stream
STREAM chunked AEAD construction (Hoang-Reyhanitabar-Rogaway-Vizár 2015).
xchacha20
XChaCha20-Poly1305 authenticated encryption for the OxiCrypto stack.

Structs§

Aes128Gcm
AES-128-GCM authenticated encryption.
Aes256Gcm
AES-256-GCM authenticated encryption.
ChaCha20Poly1305
ChaCha20-Poly1305 authenticated encryption.

Functions§

seal_with_random_nonce
Encrypt plaintext with a freshly-generated random nonce.