Skip to content

Commit 21e60ba

Browse files
authored
chore: apply unreachable_pub lint (#1062)
1 parent 305bad5 commit 21e60ba

File tree

36 files changed

+219
-204
lines changed

36 files changed

+219
-204
lines changed

dsa/src/generate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ mod keypair;
77
#[cfg(feature = "hazmat")]
88
mod secret_number;
99

10-
pub use self::components::common as common_components;
10+
pub(crate) use self::components::common as common_components;
1111
#[cfg(feature = "hazmat")]
12-
pub use self::secret_number::{secret_number, secret_number_rfc6979};
12+
pub(crate) use self::secret_number::{secret_number, secret_number_rfc6979};
1313

1414
#[cfg(feature = "hazmat")]
15-
pub use self::keypair::keypair;
15+
pub(crate) use self::keypair::keypair;
1616

1717
#[cfg(all(feature = "hazmat", feature = "pkcs8"))]
18-
pub use self::components::public as public_component;
18+
pub(crate) use self::components::public as public_component;
1919

2020
/// Calculate the upper and lower bounds for generating values like p or q
2121
#[inline]

dsa/src/generate/components.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use {crate::Components, crypto_bigint::subtle::CtOption};
2222
/// # Returns
2323
///
2424
/// Tuple of three `BoxedUint`s. Ordered like this `(p, q, g)`
25-
pub fn common<R: CryptoRng + ?Sized>(
25+
pub(crate) fn common<R: CryptoRng + ?Sized>(
2626
rng: &mut R,
2727
KeySize { l, n }: KeySize,
2828
) -> (Odd<BoxedUint>, NonZero<BoxedUint>, NonZero<BoxedUint>) {
@@ -88,7 +88,10 @@ pub fn common<R: CryptoRng + ?Sized>(
8888
/// Calculate the public component from the common components and the private component
8989
#[cfg(feature = "hazmat")]
9090
#[inline]
91-
pub fn public(components: &Components, x: &NonZero<BoxedUint>) -> CtOption<NonZero<BoxedUint>> {
91+
pub(crate) fn public(
92+
components: &Components,
93+
x: &NonZero<BoxedUint>,
94+
) -> CtOption<NonZero<BoxedUint>> {
9295
let p = components.p();
9396
let g = components.g();
9497

dsa/src/generate/keypair.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use signature::rand_core::CryptoRng;
99

1010
/// Generate a new keypair
1111
#[inline]
12-
pub fn keypair<R: CryptoRng + ?Sized>(rng: &mut R, components: Components) -> SigningKey {
12+
pub(crate) fn keypair<R: CryptoRng + ?Sized>(rng: &mut R, components: Components) -> SigningKey {
1313
#[inline]
1414
fn find_non_zero_x<R: CryptoRng + ?Sized>(
1515
rng: &mut R,

dsa/src/generate/secret_number.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn truncate_hash(hash: &[u8], desired_size: usize) -> &[u8] {
2020
///
2121
/// Secret number k and its modular multiplicative inverse with q
2222
#[inline]
23-
pub fn secret_number_rfc6979<D>(
23+
pub(crate) fn secret_number_rfc6979<D>(
2424
signing_key: &SigningKey,
2525
hash: &[u8],
2626
) -> Result<(BoxedUint, BoxedUint), signature::Error>
@@ -62,7 +62,7 @@ where
6262
///
6363
/// Secret number k and its modular multiplicative inverse with q
6464
#[inline]
65-
pub fn secret_number<R: TryCryptoRng + ?Sized>(
65+
pub(crate) fn secret_number<R: TryCryptoRng + ?Sized>(
6666
rng: &mut R,
6767
components: &Components,
6868
) -> Result<Option<(BoxedUint, BoxedUint)>, signature::Error> {

dsa/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![no_std]
22
#![forbid(unsafe_code)]
3-
#![warn(missing_docs, rust_2018_idioms)]
3+
#![warn(missing_docs, rust_2018_idioms, unreachable_pub)]
44
#![doc = include_str!("../README.md")]
55
#![doc(
66
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/8f1a9894/logo.svg",

ecdsa/src/dev.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ macro_rules! new_wycheproof_test {
224224
}
225225

226226
impl TestVector {
227-
pub fn pass(&self) -> bool {
227+
pub(crate) fn pass(&self) -> bool {
228228
match self.pass_ {
229229
&[0] => false,
230230
&[1] => true,

ecdsa/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
missing_docs,
2121
rust_2018_idioms,
2222
unused_lifetimes,
23-
unused_qualifications
23+
unused_qualifications,
24+
unreachable_pub
2425
)]
2526

2627
//! ## `serde` support

ed25519/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
missing_docs,
1010
rust_2018_idioms,
1111
unused_lifetimes,
12-
unused_qualifications
12+
unused_qualifications,
13+
unreachable_pub
1314
)]
1415

1516
//! # Using Ed25519 generically over algorithm implementations/providers

ed448/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
missing_docs,
1010
rust_2018_idioms,
1111
unused_lifetimes,
12-
unused_qualifications
12+
unused_qualifications,
13+
unreachable_pub
1314
)]
1415

1516
//! # Using Ed448 generically over algorithm implementations/providers

lms/src/constants.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! Constants as defined in RFC 8554
22
33
/// The length of the identifier `I`
4-
pub const ID_LEN: usize = 16;
4+
pub(crate) const ID_LEN: usize = 16;
55

66
/// `D_PBLC`
7-
pub const D_PBLC: [u8; 2] = [0x80, 0x80];
7+
pub(crate) const D_PBLC: [u8; 2] = [0x80, 0x80];
88
/// `D_MESG`
9-
pub const D_MESG: [u8; 2] = [0x81, 0x81];
9+
pub(crate) const D_MESG: [u8; 2] = [0x81, 0x81];
1010
/// `D_LEAF`
11-
pub const D_LEAF: [u8; 2] = [0x82, 0x82];
11+
pub(crate) const D_LEAF: [u8; 2] = [0x82, 0x82];
1212
/// `D_INTR`
13-
pub const D_INTR: [u8; 2] = [0x83, 0x83];
13+
pub(crate) const D_INTR: [u8; 2] = [0x83, 0x83];

0 commit comments

Comments
 (0)