Skip to content

Commit 38b0057

Browse files
authored
Constant tobytes of Fp is in the wrong direction (#108)
1 parent f30b173 commit 38b0057

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/fields/fp/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ impl<F: PrimeField> ToBytesGadget<F> for FpVar<F> {
920920
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
921921
match self {
922922
Self::Constant(c) => Ok(UInt8::constant_vec(
923-
c.into_bigint().to_bytes_be().as_slice(),
923+
c.into_bigint().to_bytes_le().as_slice(),
924924
)),
925925
Self::Var(v) => v.to_bytes(),
926926
}
@@ -930,7 +930,7 @@ impl<F: PrimeField> ToBytesGadget<F> for FpVar<F> {
930930
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
931931
match self {
932932
Self::Constant(c) => Ok(UInt8::constant_vec(
933-
c.into_bigint().to_bytes_be().as_slice(),
933+
c.into_bigint().to_bytes_le().as_slice(),
934934
)),
935935
Self::Var(v) => v.to_non_unique_bytes(),
936936
}

src/pairing/bls12/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::{
88
};
99
use ark_ec::bls12::{Bls12, Bls12Parameters, TwistType};
1010
use ark_ff::BitIteratorBE;
11-
use core::marker::PhantomData;
11+
use ark_std::marker::PhantomData;
1212

1313
/// Specifies the constraints for computing a pairing in a BLS12 bilinear group.
1414
pub struct PairingVar<P: Bls12Parameters>(PhantomData<P>);

0 commit comments

Comments
 (0)