From 83e565ba0f5c3433ce68f6e80c7373d8fe912e25 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Thu, 15 Feb 2024 16:54:43 -0800 Subject: [PATCH 1/9] Added Nonce docs to aes_gcm. --- aes-gcm/src/lib.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index f7a26513..8fba365b 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -130,6 +130,43 @@ pub const P_MAX: u64 = 1 << 36; pub const C_MAX: u64 = (1 << 36) + 16; /// AES-GCM nonces. +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. +/// +/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't +/// need to generate nonces yourself. +/// +/// ```rust +/// use aes_gcm::{Aes256Gcm, AeadCore, Nonce}; +/// +/// // Generate a 0-initialized GenericArray with the right size to be used as a Nonce +/// // for a Aes256Gcm. +/// let empty_nonce_for_aes_256_gcm = Nonce::<::NonceSize>::default(); +/// +/// // Remember that this crate re-exports aead which re-exports generic_array at the +/// // correct version for this crate: +/// use aes_gcm::aead::generic_array::GenericArray; +/// +/// // Both Aes256Gcm and Aes128Gcm use 12-byte nonces. GenericArray's support casting to and +/// // from correctly sized arrays and slices and deref to slices similar to regular Rust arrays. +/// let mut another_empty_nonce = +/// GenericArray::::NonceSize>::from([0u8; 12]); +/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { +/// *byte = i as u8; +/// } +/// +/// // They work! +/// +/// use aes_gcm::{aead::Aead, KeyInit, Key}; +/// +/// let bad_key_for_bad_nonces = b"01234567890123456789012345678901"; +/// // Key is also a GenericArray and has the same implementations. +/// let cipher = Aes256Gcm::new(Key::::from_slice(bad_key_for_bad_nonces)); +/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); +/// ``` pub type Nonce = GenericArray; /// AES-GCM tags. From 7b467ae9e4a55edf1a03ed62048a0397a15ea18f Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Thu, 15 Feb 2024 16:57:16 -0800 Subject: [PATCH 2/9] Finish docs for typedefs for GenericArray in aes_gcm. --- aes-gcm/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index 8fba365b..c2ec80be 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -170,6 +170,11 @@ pub const C_MAX: u64 = (1 << 36) + 16; pub type Nonce = GenericArray; /// AES-GCM tags. +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. pub type Tag = GenericArray; /// Trait implemented for valid tag sizes, i.e. From bedd03c851baf18813637de92c7bcadc41f6be82 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Thu, 15 Feb 2024 22:56:16 -0800 Subject: [PATCH 3/9] Add relevant docs to aes_siv and touch up a line to aes_gcm. --- aes-gcm/src/lib.rs | 2 +- aes-siv/src/lib.rs | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index c2ec80be..f82a40eb 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -163,7 +163,7 @@ pub const C_MAX: u64 = (1 << 36) + 16; /// use aes_gcm::{aead::Aead, KeyInit, Key}; /// /// let bad_key_for_bad_nonces = b"01234567890123456789012345678901"; -/// // Key is also a GenericArray and has the same implementations. +/// // Key is also a GenericArray and thus has the same implementations. /// let cipher = Aes256Gcm::new(Key::::from_slice(bad_key_for_bad_nonces)); /// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); /// ``` diff --git a/aes-siv/src/lib.rs b/aes-siv/src/lib.rs index ebe917d1..a67aa5cd 100644 --- a/aes-siv/src/lib.rs +++ b/aes-siv/src/lib.rs @@ -105,9 +105,52 @@ use digest::{FixedOutputReset, Mac}; use pmac::Pmac; /// AES-SIV nonces +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. +/// +/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't +/// need to generate nonces yourself. +/// +/// ```rust +/// use aes_siv::{Aes256SivAead, AeadCore, Nonce}; +/// +/// // Generate a 0-initialized GenericArray with the right size to be used as a Nonce +/// // for a Aes256SivAead. +/// let empty_nonce_for_aes_256_siv = Nonce::<::NonceSize>::default(); +/// +/// // Remember that this crate re-exports aead which re-exports generic_array at the +/// // correct version for this crate: +/// use aes_siv::aead::generic_array::GenericArray; +/// +/// // Both Aes256SivAead and Aes128SivAead use 16-byte nonces. GenericArray's support casting to and +/// // from correctly sized arrays and slices and deref to slices similar to regular Rust arrays. +/// let mut another_empty_nonce = +/// GenericArray::::NonceSize>::from([0u8; 16]); +/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { +/// *byte = i as u8; +/// } +/// +/// // They work! +/// +/// use aes_siv::{aead::Aead, KeyInit, Key}; +/// +/// let bad_key_for_bad_nonces = +/// b"I will not use const keys. I will not use const keys. I will not"; +/// // Key is also a GenericArray and thus has the same implementations. +/// let cipher = Aes256SivAead::new(Key::::from_slice(bad_key_for_bad_nonces)); +/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); +/// ``` pub type Nonce = GenericArray; /// AES-SIV tags (i.e. the Synthetic Initialization Vector value) +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. pub type Tag = GenericArray; /// The `SivAead` type wraps the more powerful `Siv` interface in a more From e3b2e955baa74ae6f72bc8c4bf00870b500f6562 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 09:28:55 -0800 Subject: [PATCH 4/9] Add docs for CCM. --- ccm/src/lib.rs | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/ccm/src/lib.rs b/ccm/src/lib.rs index b6e75d74..231bf9a3 100644 --- a/ccm/src/lib.rs +++ b/ccm/src/lib.rs @@ -58,9 +58,60 @@ use subtle::ConstantTimeEq; mod private; /// CCM nonces +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. +/// +/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't +/// need to generate nonces yourself. +/// +/// ```rust +/// use ccm::{consts::U13, Nonce}; +/// +/// // Generate a 0-initialized GenericArray to be used as a 13-byte Nonce. +/// // CCM nonce sizes may be from 7 to 13 with 13 being the strongest. +/// let empty_13_byte_nonce = Nonce::::default(); +/// +/// // Remember that this crate re-exports aead which re-exports generic_array at the +/// // correct version for this crate: +/// use ccm::aead::generic_array::GenericArray; +/// +/// // GenericArray's support casting to and from correctly sized arrays and slices and +/// // deref to slices similar to regular Rust arrays. +/// let mut another_empty_nonce = +/// GenericArray::::from([0u8; 13]); +/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { +/// *byte = i as u8; +/// } +/// +/// // If we have a pre-defined Ccm type we want to use, we can use its implementation +/// // of AeadCore to extract the nonce size it uses. +/// use ccm::{aead::AeadCore, consts::U10, Ccm}; +/// // As it stands, this crate is currently BYOA (Bring Your Own AES). +/// use aes::Aes256; +/// +/// type Aes256Ccm = Ccm; +/// type NonceSize = ::NonceSize; +/// +/// // They work! +/// +/// use ccm::{aead::Aead, KeyInit, Key}; +/// +/// let bad_key_for_bad_nonces = b"01234567890123456789012345678901"; +/// // Key is also a GenericArray and thus has the same implementations. +/// let cipher = Ccm::::new(Key::::from_slice(bad_key_for_bad_nonces)); +/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); +/// ``` pub type Nonce = GenericArray; /// CCM tags +/// +/// Note: This crate uses +/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) +/// to represent this type internally. See the linked documentation to see available +/// associated functions and trait implementations. pub type Tag = GenericArray; /// Trait implemented for valid tag sizes, i.e. From cdb9c802b726a9a1c2be3c5c8135aa4c24fcfcf6 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 10:12:15 -0800 Subject: [PATCH 5/9] Chop down excessive documentation and fix docs for chacha... --- aes-gcm/src/lib.rs | 46 ++++--------------------------- aes-siv/src/lib.rs | 47 ++++--------------------------- ccm/src/lib.rs | 55 ++++--------------------------------- chacha20poly1305/src/lib.rs | 16 ++++++++--- 4 files changed, 30 insertions(+), 134 deletions(-) diff --git a/aes-gcm/src/lib.rs b/aes-gcm/src/lib.rs index f82a40eb..51565517 100644 --- a/aes-gcm/src/lib.rs +++ b/aes-gcm/src/lib.rs @@ -131,50 +131,16 @@ pub const C_MAX: u64 = (1 << 36) + 16; /// AES-GCM nonces. /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. -/// -/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't -/// need to generate nonces yourself. -/// -/// ```rust -/// use aes_gcm::{Aes256Gcm, AeadCore, Nonce}; -/// -/// // Generate a 0-initialized GenericArray with the right size to be used as a Nonce -/// // for a Aes256Gcm. -/// let empty_nonce_for_aes_256_gcm = Nonce::<::NonceSize>::default(); -/// -/// // Remember that this crate re-exports aead which re-exports generic_array at the -/// // correct version for this crate: -/// use aes_gcm::aead::generic_array::GenericArray; -/// -/// // Both Aes256Gcm and Aes128Gcm use 12-byte nonces. GenericArray's support casting to and -/// // from correctly sized arrays and slices and deref to slices similar to regular Rust arrays. -/// let mut another_empty_nonce = -/// GenericArray::::NonceSize>::from([0u8; 12]); -/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { -/// *byte = i as u8; -/// } -/// -/// // They work! -/// -/// use aes_gcm::{aead::Aead, KeyInit, Key}; -/// -/// let bad_key_for_bad_nonces = b"01234567890123456789012345678901"; -/// // Key is also a GenericArray and thus has the same implementations. -/// let cipher = Aes256Gcm::new(Key::::from_slice(bad_key_for_bad_nonces)); -/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); -/// ``` +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// AES-GCM tags. /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; /// Trait implemented for valid tag sizes, i.e. diff --git a/aes-siv/src/lib.rs b/aes-siv/src/lib.rs index a67aa5cd..32a282f5 100644 --- a/aes-siv/src/lib.rs +++ b/aes-siv/src/lib.rs @@ -106,51 +106,16 @@ use pmac::Pmac; /// AES-SIV nonces /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. -/// -/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't -/// need to generate nonces yourself. -/// -/// ```rust -/// use aes_siv::{Aes256SivAead, AeadCore, Nonce}; -/// -/// // Generate a 0-initialized GenericArray with the right size to be used as a Nonce -/// // for a Aes256SivAead. -/// let empty_nonce_for_aes_256_siv = Nonce::<::NonceSize>::default(); -/// -/// // Remember that this crate re-exports aead which re-exports generic_array at the -/// // correct version for this crate: -/// use aes_siv::aead::generic_array::GenericArray; -/// -/// // Both Aes256SivAead and Aes128SivAead use 16-byte nonces. GenericArray's support casting to and -/// // from correctly sized arrays and slices and deref to slices similar to regular Rust arrays. -/// let mut another_empty_nonce = -/// GenericArray::::NonceSize>::from([0u8; 16]); -/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { -/// *byte = i as u8; -/// } -/// -/// // They work! -/// -/// use aes_siv::{aead::Aead, KeyInit, Key}; -/// -/// let bad_key_for_bad_nonces = -/// b"I will not use const keys. I will not use const keys. I will not"; -/// // Key is also a GenericArray and thus has the same implementations. -/// let cipher = Aes256SivAead::new(Key::::from_slice(bad_key_for_bad_nonces)); -/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); -/// ``` +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// AES-SIV tags (i.e. the Synthetic Initialization Vector value) /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; /// The `SivAead` type wraps the more powerful `Siv` interface in a more diff --git a/ccm/src/lib.rs b/ccm/src/lib.rs index 231bf9a3..3d567fdc 100644 --- a/ccm/src/lib.rs +++ b/ccm/src/lib.rs @@ -59,59 +59,16 @@ mod private; /// CCM nonces /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. -/// -/// Note before the examples, you probably want to use [`AeadCore::generate_nonce`] and don't -/// need to generate nonces yourself. -/// -/// ```rust -/// use ccm::{consts::U13, Nonce}; -/// -/// // Generate a 0-initialized GenericArray to be used as a 13-byte Nonce. -/// // CCM nonce sizes may be from 7 to 13 with 13 being the strongest. -/// let empty_13_byte_nonce = Nonce::::default(); -/// -/// // Remember that this crate re-exports aead which re-exports generic_array at the -/// // correct version for this crate: -/// use ccm::aead::generic_array::GenericArray; -/// -/// // GenericArray's support casting to and from correctly sized arrays and slices and -/// // deref to slices similar to regular Rust arrays. -/// let mut another_empty_nonce = -/// GenericArray::::from([0u8; 13]); -/// for (i, byte) in another_empty_nonce.iter_mut().enumerate() { -/// *byte = i as u8; -/// } -/// -/// // If we have a pre-defined Ccm type we want to use, we can use its implementation -/// // of AeadCore to extract the nonce size it uses. -/// use ccm::{aead::AeadCore, consts::U10, Ccm}; -/// // As it stands, this crate is currently BYOA (Bring Your Own AES). -/// use aes::Aes256; -/// -/// type Aes256Ccm = Ccm; -/// type NonceSize = ::NonceSize; -/// -/// // They work! -/// -/// use ccm::{aead::Aead, KeyInit, Key}; -/// -/// let bad_key_for_bad_nonces = b"01234567890123456789012345678901"; -/// // Key is also a GenericArray and thus has the same implementations. -/// let cipher = Ccm::::new(Key::::from_slice(bad_key_for_bad_nonces)); -/// cipher.encrypt(&another_empty_nonce, b"Goodbye World; I've been pwned!".as_ref()).unwrap(); -/// ``` +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// CCM tags /// -/// Note: This crate uses -/// [`generic_array::GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html) -/// to represent this type internally. See the linked documentation to see available -/// associated functions and trait implementations. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; /// Trait implemented for valid tag sizes, i.e. diff --git a/chacha20poly1305/src/lib.rs b/chacha20poly1305/src/lib.rs index de0b8eed..27548ce0 100644 --- a/chacha20poly1305/src/lib.rs +++ b/chacha20poly1305/src/lib.rs @@ -161,7 +161,9 @@ use chacha20::{ChaCha12, ChaCha8, XChaCha12, XChaCha8}; /// Key type (256-bits/32-bytes). /// -/// Implemented as an alias for [`GenericArray`]. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. /// /// All [`ChaChaPoly1305`] variants (including `XChaCha20Poly1305`) use this /// key type. @@ -169,17 +171,23 @@ pub type Key = GenericArray; /// Nonce type (96-bits/12-bytes). /// -/// Implemented as an alias for [`GenericArray`]. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// XNonce type (192-bits/24-bytes). /// -/// Implemented as an alias for [`GenericArray`]. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type XNonce = GenericArray; /// Poly1305 tag. /// -/// Implemented as an alias for [`GenericArray`]. +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; /// ChaCha20Poly1305 Authenticated Encryption with Additional Data (AEAD). From ab2bd3dbe660c7807c4c2870ee7298a035d3df3d Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 11:39:08 -0800 Subject: [PATCH 6/9] Fix docs for ascon-aead --- ascon-aead/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ascon-aead/src/lib.rs b/ascon-aead/src/lib.rs index 81774e94..22acb637 100644 --- a/ascon-aead/src/lib.rs +++ b/ascon-aead/src/lib.rs @@ -178,10 +178,22 @@ impl AeadInPlace for Ascon

{ /// Ascon-128 pub struct Ascon128(Ascon); /// Key for Ascon-128 +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Ascon128Key = Key; /// Nonce for Ascon-128 +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Ascon128Nonce = Nonce; /// Tag for Ascon-128 +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Ascon128Tag = Tag; impl KeySizeUser for Ascon128 { From cc08e05f37aa1476056f48ad814febc2d02fd6a5 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 11:41:08 -0800 Subject: [PATCH 7/9] Fix docs for deoxys. --- deoxys/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deoxys/src/lib.rs b/deoxys/src/lib.rs index 7d44b2e1..648da06c 100644 --- a/deoxys/src/lib.rs +++ b/deoxys/src/lib.rs @@ -133,9 +133,17 @@ pub type DeoxysII128 = Deoxys, deoxys_bc pub type DeoxysII256 = Deoxys, deoxys_bc::DeoxysBc384>; /// Deoxys nonces +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// Deoxys tags +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; /// Deoxys encryption modes. From 9ae8cb611ca513e6e53d9a9209677d15a591d3a7 Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 11:45:25 -0800 Subject: [PATCH 8/9] Fix docs for eax. --- eax/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eax/src/lib.rs b/eax/src/lib.rs index e8323d74..a9af517f 100644 --- a/eax/src/lib.rs +++ b/eax/src/lib.rs @@ -148,9 +148,17 @@ pub const P_MAX: u64 = 1 << 36; pub const C_MAX: u64 = (1 << 36) + 16; /// EAX nonces +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// EAX tags +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; pub mod online; From 8ed1663cf1340ef2afa706613720cdf717f3540a Mon Sep 17 00:00:00 2001 From: Sophia Waggoner Date: Fri, 16 Feb 2024 14:42:43 -0800 Subject: [PATCH 9/9] Fix docs for mgm. --- mgm/src/lib.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mgm/src/lib.rs b/mgm/src/lib.rs index eca92e1a..cea90a61 100644 --- a/mgm/src/lib.rs +++ b/mgm/src/lib.rs @@ -48,11 +48,24 @@ use sealed::Sealed; cpufeatures::new!(mul_intrinsics, "sse2", "ssse3", "pclmulqdq"); /// MGM nonces +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Nonce = GenericArray; /// MGM tags +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. pub type Tag = GenericArray; +/// MGM blocks +/// +/// Implemented as an alias for +/// [`GenericArray`](https://docs.rs/generic-array/0.14.5/generic_array/struct.GenericArray.html). +/// Note that this crate re-exports aead which re-exports GenericArray. type Block = GenericArray::BlockSize>; // cipher, nonce, aad, buffer type EncArgs<'a, C> = (&'a C, &'a Block, &'a [u8], &'a mut [u8]);