Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elliptic-curve: non_zero => nonzero #828

Merged
merged 1 commit into from Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion elliptic-curve/src/lib.rs
Expand Up @@ -98,7 +98,7 @@ pub use {
AffineArithmetic, PrimeCurveArithmetic, ProjectiveArithmetic, ScalarArithmetic,
},
public_key::PublicKey,
scalar::{non_zero::NonZeroScalar, Scalar},
scalar::{nonzero::NonZeroScalar, Scalar},
},
ff::{self, Field, PrimeField},
group::{self, Group},
Expand Down
2 changes: 1 addition & 1 deletion elliptic-curve/src/ops.rs
Expand Up @@ -48,5 +48,5 @@ pub trait Reduce<UInt: Integer + ArrayEncoding>: Sized {
/// End users can use the `Reduce` impl on `NonZeroScalar` instead.
pub trait ReduceNonZero<UInt: Integer + ArrayEncoding>: Sized {
/// Perform a modular reduction, returning a field element.
fn from_uint_reduced_non_zero(n: UInt) -> Self;
fn from_uint_reduced_nonzero(n: UInt) -> Self;
}
2 changes: 1 addition & 1 deletion elliptic-curve/src/scalar.rs
Expand Up @@ -5,7 +5,7 @@ use subtle::Choice;
pub(crate) mod core;

#[cfg(feature = "arithmetic")]
pub(crate) mod non_zero;
pub(crate) mod nonzero;

#[cfg(feature = "arithmetic")]
use crate::ScalarArithmetic;
Expand Down
Expand Up @@ -207,7 +207,7 @@ where
Scalar<C>: ReduceNonZero<I>,
{
fn from_uint_reduced(n: I) -> Self {
Self::from_uint_reduced_non_zero(n)
Self::from_uint_reduced_nonzero(n)
}
}

Expand All @@ -217,8 +217,8 @@ where
I: Integer + ArrayEncoding,
Scalar<C>: ReduceNonZero<I>,
{
fn from_uint_reduced_non_zero(n: I) -> Self {
let scalar = Scalar::<C>::from_uint_reduced_non_zero(n);
fn from_uint_reduced_nonzero(n: I) -> Self {
let scalar = Scalar::<C>::from_uint_reduced_nonzero(n);
debug_assert!(!bool::from(scalar.is_zero()));
Self::new(scalar).unwrap()
}
Expand Down