mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-09 07:21:29 +01:00
Constant tobytes of Fp is in the wrong direction (#108)
This commit is contained in:
@@ -920,7 +920,7 @@ impl<F: PrimeField> ToBytesGadget<F> for FpVar<F> {
|
|||||||
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
fn to_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
||||||
match self {
|
match self {
|
||||||
Self::Constant(c) => Ok(UInt8::constant_vec(
|
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(),
|
Self::Var(v) => v.to_bytes(),
|
||||||
}
|
}
|
||||||
@@ -930,7 +930,7 @@ impl<F: PrimeField> ToBytesGadget<F> for FpVar<F> {
|
|||||||
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
fn to_non_unique_bytes(&self) -> Result<Vec<UInt8<F>>, SynthesisError> {
|
||||||
match self {
|
match self {
|
||||||
Self::Constant(c) => Ok(UInt8::constant_vec(
|
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(),
|
Self::Var(v) => v.to_non_unique_bytes(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
use ark_ec::bls12::{Bls12, Bls12Parameters, TwistType};
|
use ark_ec::bls12::{Bls12, Bls12Parameters, TwistType};
|
||||||
use ark_ff::BitIteratorBE;
|
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.
|
/// Specifies the constraints for computing a pairing in a BLS12 bilinear group.
|
||||||
pub struct PairingVar<P: Bls12Parameters>(PhantomData<P>);
|
pub struct PairingVar<P: Bls12Parameters>(PhantomData<P>);
|
||||||
|
|||||||
Reference in New Issue
Block a user