These structures are no longer exported outside the crate, and these assertions are unnecessary now that the external API can enforce them.

This commit is contained in:
Sean Bowe 2017-09-28 08:12:37 -06:00
parent 06f6334679
commit 894b44d034
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
2 changed files with 4 additions and 13 deletions

View File

@ -12,6 +12,7 @@
#![cfg_attr(feature = "clippy", allow(inline_always))] #![cfg_attr(feature = "clippy", allow(inline_always))]
#![cfg_attr(feature = "clippy", allow(too_many_arguments))] #![cfg_attr(feature = "clippy", allow(too_many_arguments))]
#![cfg_attr(feature = "clippy", allow(unreadable_literal))] #![cfg_attr(feature = "clippy", allow(unreadable_literal))]
#![cfg_attr(feature = "clippy", allow(new_without_default_derive))]
// Force public structures to implement Debug // Force public structures to implement Debug
#![deny(missing_debug_implementations)] #![deny(missing_debug_implementations)]

View File

@ -1,13 +1,8 @@
use super::{CurveProjective, PrimeFieldRepr, PrimeField}; use super::{CurveProjective, PrimeFieldRepr, PrimeField};
/// Replaces the contents of `table` with a w-NAF window table for the given window size. /// Replaces the contents of `table` with a w-NAF window table for the given window size.
/// pub(crate) fn wnaf_table<G: CurveProjective>(table: &mut Vec<G>, mut base: G, window: usize)
/// This function will panic if provided a window size below two, or above 22.
pub fn wnaf_table<G: CurveProjective>(table: &mut Vec<G>, mut base: G, window: usize)
{ {
assert!(window < 23);
assert!(window > 1);
table.truncate(0); table.truncate(0);
table.reserve(1 << (window-1)); table.reserve(1 << (window-1));
@ -21,13 +16,8 @@ pub fn wnaf_table<G: CurveProjective>(table: &mut Vec<G>, mut base: G, window: u
} }
/// Replaces the contents of `wnaf` with the w-NAF representation of a scalar. /// Replaces the contents of `wnaf` with the w-NAF representation of a scalar.
/// pub(crate) fn wnaf_form<S: PrimeFieldRepr>(wnaf: &mut Vec<i64>, mut c: S, window: usize)
/// This function will panic if provided a window size below two, or above 22.
pub fn wnaf_form<S: PrimeFieldRepr>(wnaf: &mut Vec<i64>, mut c: S, window: usize)
{ {
assert!(window < 23);
assert!(window > 1);
wnaf.truncate(0); wnaf.truncate(0);
while !c.is_zero() { while !c.is_zero() {
@ -58,7 +48,7 @@ pub fn wnaf_form<S: PrimeFieldRepr>(wnaf: &mut Vec<i64>, mut c: S, window: usize
/// ///
/// This function must be provided a `table` and `wnaf` that were constructed with /// 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. /// the same window size; otherwise, it may panic or produce invalid results.
pub fn wnaf_exp<G: CurveProjective>(table: &[G], wnaf: &[i64]) -> G pub(crate) fn wnaf_exp<G: CurveProjective>(table: &[G], wnaf: &[i64]) -> G
{ {
let mut result = G::zero(); let mut result = G::zero();