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

Add to_bytes to bigint #166

Merged
merged 11 commits into from
Jan 7, 2021
2 changes: 1 addition & 1 deletion ec/src/msm/fixed_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl FixedBaseMSM {
scalar: &T::ScalarField,
) -> T {
let modulus_size = <T::ScalarField as PrimeField>::Params::MODULUS_BITS as usize;
let mut scalar_val = scalar.into_repr().to_bits();
let mut scalar_val = scalar.into_repr().to_bits_be();
scalar_val.reverse();
ValarDragon marked this conversation as resolved.
Show resolved Hide resolved

let mut res = multiples_of_g[0][0].into_projective();
Expand Down
4 changes: 2 additions & 2 deletions ff/src/biginteger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ pub trait BigInteger:
/// with leading zeros.
fn to_bytes_be(&self) -> Vec<u8>;

/// Returns the byte representation in a big endian byte array,
/// with leading zeros.
/// Returns the byte representation in a little endian byte array,
/// with trailing zeros.
fn to_bytes_le(&self) -> Vec<u8>;

/// Returns a vector for wnaf.
Expand Down