From 38b005731992c4319f13025f1a55afd0fea63dbc Mon Sep 17 00:00:00 2001 From: onewayfunc <56660958+onewayfunc@users.noreply.github.com> Date: Sun, 30 Oct 2022 15:03:44 -0700 Subject: [PATCH] Constant tobytes of Fp is in the wrong direction (#108) --- src/fields/fp/mod.rs | 4 ++-- src/pairing/bls12/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fields/fp/mod.rs b/src/fields/fp/mod.rs index f499043..2486309 100644 --- a/src/fields/fp/mod.rs +++ b/src/fields/fp/mod.rs @@ -920,7 +920,7 @@ impl ToBytesGadget for FpVar { fn to_bytes(&self) -> Result>, SynthesisError> { match self { Self::Constant(c) => Ok(UInt8::constant_vec( - c.into_bigint().to_bytes_be().as_slice(), + c.into_bigint().to_bytes_le().as_slice(), )), Self::Var(v) => v.to_bytes(), } @@ -930,7 +930,7 @@ impl ToBytesGadget for FpVar { fn to_non_unique_bytes(&self) -> Result>, SynthesisError> { match self { Self::Constant(c) => Ok(UInt8::constant_vec( - c.into_bigint().to_bytes_be().as_slice(), + c.into_bigint().to_bytes_le().as_slice(), )), Self::Var(v) => v.to_non_unique_bytes(), } diff --git a/src/pairing/bls12/mod.rs b/src/pairing/bls12/mod.rs index c6642ed..91adbb7 100644 --- a/src/pairing/bls12/mod.rs +++ b/src/pairing/bls12/mod.rs @@ -8,7 +8,7 @@ use crate::{ }; use ark_ec::bls12::{Bls12, Bls12Parameters, TwistType}; use ark_ff::BitIteratorBE; -use core::marker::PhantomData; +use ark_std::marker::PhantomData; /// Specifies the constraints for computing a pairing in a BLS12 bilinear group. pub struct PairingVar(PhantomData

);