Skip to content

Commit b12a8ac

Browse files
committed
frodo-kem: enable and fix workspace-level lints
...or ignore them for now! This one's kind of on the backburner. Enables the workspace-level lint config added in #232
1 parent 5127785 commit b12a8ac

File tree

11 files changed

+256
-187
lines changed

11 files changed

+256
-187
lines changed

dhkem/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
66
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
77
)]
8-
#![warn(missing_docs)]
98

109
//! # Diffie-Hellman (DH) based Key Encapsulation Mechanisms (KEM)
1110
//!

frodo-kem/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ features = [
101101
]
102102
rustdoc-args = ["--cfg", "docsrs"]
103103

104+
[lints]
105+
workspace = true
106+
104107
[[bench]]
105108
name = "frodo"
106109
harness = false

frodo-kem/benches/frodo.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
//! `FrodoKEM` benchmarks.
2+
3+
#![allow(missing_docs, reason = "benchmarks")]
4+
#![allow(clippy::unwrap_used, reason = "benchmarks")]
5+
16
use criterion::{
27
BenchmarkGroup, Criterion, criterion_group, criterion_main, measurement::Measurement,
38
};

frodo-kem/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use thiserror::Error;
22

3-
/// The errors that can occur for FrodoKEM
3+
/// The errors that can occur for `FrodoKEM`
44
#[derive(Error, Copy, Clone, Debug)]
55
pub enum Error {
66
/// The secret key length is invalid
@@ -23,5 +23,5 @@ pub enum Error {
2323
UnsupportedAlgorithm,
2424
}
2525

26-
/// The result type for FrodoKEM
26+
/// The result type for `FrodoKEM`
2727
pub type FrodoResult<T> = Result<T, Error>;

frodo-kem/src/hazmat.rs

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
//! ⚠️ Low-level "hazmat" FrodoKEM and eFrodoKEM functions.
1+
//! ⚠️ Low-level "hazmat" `FrodoKEM` and eFrodoKEM functions.
22
//!
33
//! # ☢️️ WARNING: HAZARDOUS API ☢️
44
//!
5-
//! This module contains the low-level API for the FrodoKEM algorithm.
5+
//! This module contains the low-level API for the `FrodoKEM` algorithm.
66
//! Only use if you know what you're doing.
77
//!
8-
//! This layer provides several traits for mixing and matching FrodoKEM components:
8+
//! This layer provides several traits for mixing and matching `FrodoKEM` components:
99
//!
10-
//! [`Params`] for specifying the constant parameters of the FrodoKEM algorithm.
10+
//! [`Params`] for specifying the constant parameters of the `FrodoKEM` algorithm.
1111
//! [`Expanded`] for specifying the expand seed A method.
1212
//! [`Sample`] for specifying the noise sampling method.
13-
//! [`Kem`] encompasses the entire FrodoKEM algorithm and each function can be overridden.
13+
//! [`Kem`] encompasses the entire `FrodoKEM` algorithm and each function can be overridden.
1414
//!
15-
//! There are default implementations for each of these traits that can be used to create a FrodoKEM instance.
15+
//! There are default implementations for each of these traits that can be used to create a `FrodoKEM` instance.
1616
//!
1717
//! There are:
18-
//! [`Frodo640`], [`Frodo976`], and [`Frodo1344`] for the FrodoKEM parameter sets.
18+
//! [`Frodo640`], [`Frodo976`], and [`Frodo1344`] for the `FrodoKEM` parameter sets.
1919
//! [`FrodoAes`] and [`FrodoShake`] for the expand seed A methods.
2020
//! [`FrodoCdfSample`] for the noise sampling method.
2121
//!
22-
//! [`FrodoKem`] is the default implementation of the FrodoKEM algorithm that combines
22+
//! [`FrodoKem`] is the default implementation of the `FrodoKEM` algorithm that combines
2323
//! all of the above traits using generics.
2424
//!
25-
//! There are also type aliases for each standardized FrodoKEM algorithm:
25+
//! There are also type aliases for each standardized `FrodoKEM` algorithm:
2626
//!
2727
//! [`FrodoKem640Aes`], [`FrodoKem976Aes`], and [`FrodoKem1344Aes`] for the FrodoKEM-AES algorithms.
2828
//! [`FrodoKem640Shake`], [`FrodoKem976Shake`], and [`FrodoKem1344Shake`] for the FrodoKEM-SHAKE algorithms.
@@ -32,76 +32,80 @@
3232
mod models;
3333
mod traits;
3434

35-
pub use models::*;
36-
pub use traits::*;
35+
pub(crate) use models::*;
36+
pub(crate) use traits::*;
3737

3838
#[cfg(feature = "frodo640aes")]
3939
/// The FrodoKEM-640-AES algorithm
40-
pub type FrodoKem640Aes = FrodoKem<Frodo640, FrodoAes<Frodo640>, FrodoCdfSample<Frodo640>>;
40+
pub(crate) type FrodoKem640Aes = FrodoKem<Frodo640, FrodoAes<Frodo640>, FrodoCdfSample<Frodo640>>;
4141

4242
#[cfg(feature = "frodo976aes")]
4343
/// The FrodoKEM-976-AES algorithm
44-
pub type FrodoKem976Aes = FrodoKem<Frodo976, FrodoAes<Frodo976>, FrodoCdfSample<Frodo976>>;
44+
pub(crate) type FrodoKem976Aes = FrodoKem<Frodo976, FrodoAes<Frodo976>, FrodoCdfSample<Frodo976>>;
4545

4646
#[cfg(feature = "frodo1344aes")]
4747
/// The FrodoKEM-1344-AES algorithm
48-
pub type FrodoKem1344Aes = FrodoKem<Frodo1344, FrodoAes<Frodo1344>, FrodoCdfSample<Frodo1344>>;
48+
pub(crate) type FrodoKem1344Aes =
49+
FrodoKem<Frodo1344, FrodoAes<Frodo1344>, FrodoCdfSample<Frodo1344>>;
4950

5051
#[cfg(feature = "frodo640shake")]
5152
/// The FrodoKEM-640-SHAKE algorithm
52-
pub type FrodoKem640Shake = FrodoKem<Frodo640, FrodoShake<Frodo640>, FrodoCdfSample<Frodo640>>;
53+
pub(crate) type FrodoKem640Shake =
54+
FrodoKem<Frodo640, FrodoShake<Frodo640>, FrodoCdfSample<Frodo640>>;
5355

5456
#[cfg(feature = "frodo976shake")]
5557
/// The FrodoKEM-976-SHAKE algorithm
56-
pub type FrodoKem976Shake = FrodoKem<Frodo976, FrodoShake<Frodo976>, FrodoCdfSample<Frodo976>>;
58+
pub(crate) type FrodoKem976Shake =
59+
FrodoKem<Frodo976, FrodoShake<Frodo976>, FrodoCdfSample<Frodo976>>;
5760

5861
#[cfg(feature = "frodo1344shake")]
5962
/// The FrodoKEM-1344-SHAKE algorithm
60-
pub type FrodoKem1344Shake = FrodoKem<Frodo1344, FrodoShake<Frodo1344>, FrodoCdfSample<Frodo1344>>;
63+
pub(crate) type FrodoKem1344Shake =
64+
FrodoKem<Frodo1344, FrodoShake<Frodo1344>, FrodoCdfSample<Frodo1344>>;
6165

6266
#[cfg(feature = "efrodo640aes")]
6367
/// The eFrodoKEM-640-AES algorithm
64-
pub type EphemeralFrodoKem640Aes = EphemeralFrodoKem<
68+
pub(crate) type EphemeralFrodoKem640Aes = EphemeralFrodoKem<
6569
EphemeralFrodo640,
6670
FrodoAes<EphemeralFrodo640>,
6771
FrodoCdfSample<EphemeralFrodo640>,
6872
>;
6973

7074
#[cfg(feature = "efrodo976aes")]
7175
/// The eFrodoKEM-976-AES algorithm
72-
pub type EphemeralFrodoKem976Aes = EphemeralFrodoKem<
76+
pub(crate) type EphemeralFrodoKem976Aes = EphemeralFrodoKem<
7377
EphemeralFrodo976,
7478
FrodoAes<EphemeralFrodo976>,
7579
FrodoCdfSample<EphemeralFrodo976>,
7680
>;
7781

7882
#[cfg(feature = "efrodo1344aes")]
7983
/// The eFrodoKEM-1344-AES algorithm
80-
pub type EphemeralFrodoKem1344Aes = EphemeralFrodoKem<
84+
pub(crate) type EphemeralFrodoKem1344Aes = EphemeralFrodoKem<
8185
EphemeralFrodo1344,
8286
FrodoAes<EphemeralFrodo1344>,
8387
FrodoCdfSample<EphemeralFrodo1344>,
8488
>;
8589

8690
#[cfg(feature = "efrodo640shake")]
8791
/// The eFrodoKEM-640-SHAKE algorithm
88-
pub type EphemeralFrodoKem640Shake = EphemeralFrodoKem<
92+
pub(crate) type EphemeralFrodoKem640Shake = EphemeralFrodoKem<
8993
EphemeralFrodo640,
9094
FrodoShake<EphemeralFrodo640>,
9195
FrodoCdfSample<EphemeralFrodo640>,
9296
>;
9397

9498
#[cfg(feature = "efrodo976shake")]
9599
/// The eFrodoKEM-976-SHAKE algorithm
96-
pub type EphemeralFrodoKem976Shake = EphemeralFrodoKem<
100+
pub(crate) type EphemeralFrodoKem976Shake = EphemeralFrodoKem<
97101
EphemeralFrodo976,
98102
FrodoShake<EphemeralFrodo976>,
99103
FrodoCdfSample<EphemeralFrodo976>,
100104
>;
101105

102106
#[cfg(feature = "efrodo1344shake")]
103107
/// The eFrodoKEM-1344-SHAKE algorithm
104-
pub type EphemeralFrodoKem1344Shake = EphemeralFrodoKem<
108+
pub(crate) type EphemeralFrodoKem1344Shake = EphemeralFrodoKem<
105109
EphemeralFrodo1344,
106110
FrodoShake<EphemeralFrodo1344>,
107111
FrodoCdfSample<EphemeralFrodo1344>,

0 commit comments

Comments
 (0)