diff --git a/src/lib.rs b/src/lib.rs index ae67b9921..8b6c4b06d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,7 @@ #![cfg_attr(feature = "clippy", allow(inline_always))] #![cfg_attr(feature = "clippy", allow(too_many_arguments))] #![cfg_attr(feature = "clippy", allow(unreadable_literal))] +#![cfg_attr(feature = "clippy", allow(new_without_default_derive))] // Force public structures to implement Debug #![deny(missing_debug_implementations)] diff --git a/src/wnaf.rs b/src/wnaf.rs index d4061aaec..9b009898a 100644 --- a/src/wnaf.rs +++ b/src/wnaf.rs @@ -1,13 +1,8 @@ use super::{CurveProjective, PrimeFieldRepr, PrimeField}; /// Replaces the contents of `table` with a w-NAF window table for the given window size. -/// -/// This function will panic if provided a window size below two, or above 22. -pub fn wnaf_table(table: &mut Vec, mut base: G, window: usize) +pub(crate) fn wnaf_table(table: &mut Vec, mut base: G, window: usize) { - assert!(window < 23); - assert!(window > 1); - table.truncate(0); table.reserve(1 << (window-1)); @@ -21,13 +16,8 @@ pub fn wnaf_table(table: &mut Vec, mut base: G, window: u } /// Replaces the contents of `wnaf` with the w-NAF representation of a scalar. -/// -/// This function will panic if provided a window size below two, or above 22. -pub fn wnaf_form(wnaf: &mut Vec, mut c: S, window: usize) +pub(crate) fn wnaf_form(wnaf: &mut Vec, mut c: S, window: usize) { - assert!(window < 23); - assert!(window > 1); - wnaf.truncate(0); while !c.is_zero() { @@ -58,7 +48,7 @@ pub fn wnaf_form(wnaf: &mut Vec, mut c: S, window: usize /// /// This function must be provided a `table` and `wnaf` that were constructed with /// the same window size; otherwise, it may panic or produce invalid results. -pub fn wnaf_exp(table: &[G], wnaf: &[i64]) -> G +pub(crate) fn wnaf_exp(table: &[G], wnaf: &[i64]) -> G { let mut result = G::zero();