docs(ciphers+cipher-traits):fix most broken doc-links in the ciphers and cipher-traits crates.

Some links in the documentation of the ciphers and cipher-traits were broken or linked to private fields.
This PR fixes most of these occasions and some more warnings in cargo doc.

The reaming issues are links to chacha20poly1305_ietf, that are broken because the feature experiment_libcrux corresponding feature is enabled. Analogously, disabling the feature would lead to broken links to chacha20poly1305_ietf_libcrux.
This commit is contained in:
David Niehues
2024-12-15 21:31:00 +01:00
committed by Karolin Varner
parent b9a34f4238
commit a6bac74d48
4 changed files with 16 additions and 13 deletions

View File

@@ -8,7 +8,9 @@
//! encapsulation. //! encapsulation.
//! //!
//! The [Kem] Trait describes the basic API offered by a Key Encapsulation //! The [Kem] Trait describes the basic API offered by a Key Encapsulation
//! Mechanism. Two implementations for it are provided, [StaticKEM] and [EphemeralKEM]. //! Mechanism. Two implementations for it are provided:
//! [Kyber512](../../rosenpass_oqs/kyber_512/enum.Kyber512.html) and
//! [ClassicMceliece460896](../../rosenpass_oqs/classic_mceliece_460896/enum.ClassicMceliece460896.html).
//! //!
//! An example where Alice generates a keypair and gives her public key to Bob, for Bob to //! An example where Alice generates a keypair and gives her public key to Bob, for Bob to
//! encapsulate a symmetric key and Alice to decapsulate it would look as follows. //! encapsulate a symmetric key and Alice to decapsulate it would look as follows.

View File

@@ -41,10 +41,11 @@ pub mod xaead {
pub mod hash_domain; pub mod hash_domain;
/// This crate includes two key encapsulation mechanisms. /// This crate includes two key encapsulation mechanisms.
/// Namely ClassicMceliece460896 (as [StaticKem]) and Kyber512 (as [EphemeralKem]). /// Namely ClassicMceliece460896 (also referred to as `StaticKem` sometimes) and
/// Kyber512 (also referred to as `EphemeralKem` sometimes).
/// ///
/// See [rosenpass_oqs::ClassicMceliece460896](rosenpass_oqs::ClassicMceliece460896) /// See [rosenpass_oqs::ClassicMceliece460896]
/// and [rosenpass_oqs::Kyber512](rosenpass_oqs::Kyber512) for more details on the specific KEMS. /// and [rosenpass_oqs::Kyber512] for more details on the specific KEMS.
/// ///
pub mod kem { pub mod kem {
pub use rosenpass_oqs::ClassicMceliece460896 as StaticKem; pub use rosenpass_oqs::ClassicMceliece460896 as StaticKem;

View File

@@ -10,7 +10,7 @@ use rosenpass_to::{ops::copy_slice, with_destination, To};
use rosenpass_util::typenum2const; use rosenpass_util::typenum2const;
/// Specify that the used implementation of BLAKE2b is the MAC version of BLAKE2b /// Specify that the used implementation of BLAKE2b is the MAC version of BLAKE2b
/// with output and key length of 32 bytes (see [Blake2bMac<U32>]). /// with output and key length of 32 bytes (see [Blake2bMac]).
type Impl = Blake2bMac<U32>; type Impl = Blake2bMac<U32>;
type KeyLen = <Impl as KeySizeUser>::KeySize; type KeyLen = <Impl as KeySizeUser>::KeySize;
@@ -21,17 +21,17 @@ const KEY_LEN: usize = typenum2const! { KeyLen };
/// The output length for BLAKE2b supported by this API. Currently 32 Bytes. /// The output length for BLAKE2b supported by this API. Currently 32 Bytes.
const OUT_LEN: usize = typenum2const! { OutLen }; const OUT_LEN: usize = typenum2const! { OutLen };
/// Minimal key length supported by this API (identical to [KEY_LEN]) /// Minimal key length supported by this API.
pub const KEY_MIN: usize = KEY_LEN; pub const KEY_MIN: usize = KEY_LEN;
/// maximal key length supported by this API (identical to [KEY_LEN]) /// maximal key length supported by this API.
pub const KEY_MAX: usize = KEY_LEN; pub const KEY_MAX: usize = KEY_LEN;
/// minimal output length supported by this API (identical [OUT_LEN]) /// minimal output length supported by this API.
pub const OUT_MIN: usize = OUT_LEN; pub const OUT_MIN: usize = OUT_LEN;
/// maximal output length supported by this API (identical [OUT_LEN]) /// maximal output length supported by this API.
pub const OUT_MAX: usize = OUT_LEN; pub const OUT_MAX: usize = OUT_LEN;
/// Hashes the given `data` with the [Blake2bMac<U32>] hash function under the given `key`. /// Hashes the given `data` with the [Blake2bMac] hash function under the given `key`.
/// The [KEY_LEN] and [OUT_LEN] are both set to 32 bytes (or 256 bits). /// The both the length of the output the length of the key 32 bytes (or 256 bits).
/// ///
/// # Examples /// # Examples
/// ///

View File

@@ -1,7 +1,7 @@
/// This module provides the following cryptographic schemes: /// This module provides the following cryptographic schemes:
/// - [blake2b]: The blake2b hash function /// - [blake2b]: The blake2b hash function
/// - [chacha20poly1305_ietf]: The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305) (only used when the feature `experiment_libcrux` is disabled. /// - [chacha20poly1305_ietf]: The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305) (only used when the feature `experiment_libcrux` is disabled).
/// - [chacha20poly1305_ietf_libcrux]: The Chacha20Poly1305 AEAD as implemented in [libcrux](https://github.com/cryspen/libcrux) (only used when the feature `experiment_libcrux` is enabled. /// - [chacha20poly1305_ietf_libcrux]: The Chacha20Poly1305 AEAD as implemented in [libcrux](https://github.com/cryspen/libcrux) (only used when the feature `experiment_libcrux` is enabled).
/// - [incorrect_hmac_blake2b]: An (incorrect) hmac based on [blake2b]. /// - [incorrect_hmac_blake2b]: An (incorrect) hmac based on [blake2b].
/// - [xchacha20poly1305_ietf] The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305) /// - [xchacha20poly1305_ietf] The Chacha20Poly1305 AEAD as implemented in [RustCrypto](https://crates.io/crates/chacha20poly1305)
pub mod blake2b; pub mod blake2b;