Skip to content

Commit

Permalink
x-wing: move lint configuration to lib.rs (#99)
Browse files Browse the repository at this point in the history
This is more consistent with the rest of the projects in the @RustCrypto
organization
  • Loading branch information
tarcieri authored Jan 21, 2025
1 parent de49bf1 commit e8a4dc1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions ml-kem/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
)]
#![warn(clippy::pedantic)] // Be pedantic by default
#![warn(clippy::integer_division_remainder_used)] // Be judicious about using `/` and `%`
#![allow(non_snake_case)] // Allow notation matching the spec
#![allow(clippy::clone_on_copy)] // Be explicit about moving data
#![deny(missing_docs)] // Require all public interfaces to be documented
#![warn(clippy::pedantic)] // Be pedantic by default
#![warn(clippy::integer_division_remainder_used)] // Be judicious about using `/` and `%`

//! # Usage
//!
Expand Down
7 changes: 0 additions & 7 deletions x-wing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ exclude = ["src/test-vectors.json"]
getrandom = ["rand_core/getrandom"]
zeroize = ["dep:zeroize", "ml-kem/zeroize", "x25519-dalek/zeroize"]

[lints.clippy]
pedantic = "warn" # Be pedantic by default
similar_names = { level = "allow", priority = 1 } # So we can use the names as in the RFC

[lints.rust]
missing_docs = "deny" # Require all public interfaces to be documented

[dependencies]
rand_core = { version = "0.6", default-features = false }
x25519-dalek = { version = "2.0", default-features = false, features = ["static_secrets"] }
Expand Down
3 changes: 3 additions & 0 deletions x-wing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg"
)]
#![deny(missing_docs)]
#![warn(clippy::pedantic)]

//! # Usage
//!
Expand Down Expand Up @@ -133,6 +135,7 @@ pub struct DecapsulationKey {
impl Decapsulate<Ciphertext, SharedSecret> for DecapsulationKey {
type Error = Infallible;

#[allow(clippy::similar_names)] // So we can use the names as in the RFC
fn decapsulate(&self, ct: &Ciphertext) -> Result<SharedSecret, Self::Error> {
let (sk_m, sk_x, _pk_m, pk_x) = self.expand_key();
let ss_m = sk_m.decapsulate(&ct.ct_m)?;
Expand Down

0 comments on commit e8a4dc1

Please sign in to comment.