@@ -552,7 +552,7 @@ impl<F: PrimeField> ToBytesGadget<F> for AllocatedFp<F> {
552552 /// This method enforces that the decomposition represents
553553 /// an integer that is less than `F::MODULUS`.
554554 #[ tracing:: instrument( target = "r1cs" ) ]
555- fn to_bytes ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
555+ fn to_bytes_le ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
556556 let num_bits = F :: BigInt :: NUM_LIMBS * 64 ;
557557 let mut bits = self . to_bits_le ( ) ?;
558558 let remainder = core:: iter:: repeat ( Boolean :: constant ( false ) ) . take ( num_bits - bits. len ( ) ) ;
@@ -565,7 +565,7 @@ impl<F: PrimeField> ToBytesGadget<F> for AllocatedFp<F> {
565565 }
566566
567567 #[ tracing:: instrument( target = "r1cs" ) ]
568- fn to_non_unique_bytes ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
568+ fn to_non_unique_bytes_le ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
569569 let num_bits = F :: BigInt :: NUM_LIMBS * 64 ;
570570 let mut bits = self . to_non_unique_bits_le ( ) ?;
571571 let remainder = core:: iter:: repeat ( Boolean :: constant ( false ) ) . take ( num_bits - bits. len ( ) ) ;
@@ -957,22 +957,22 @@ impl<F: PrimeField> ToBytesGadget<F> for FpVar<F> {
957957 /// Outputs the unique byte decomposition of `self` in *little-endian*
958958 /// form.
959959 #[ tracing:: instrument( target = "r1cs" ) ]
960- fn to_bytes ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
960+ fn to_bytes_le ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
961961 match self {
962962 Self :: Constant ( c) => Ok ( UInt8 :: constant_vec (
963963 c. into_bigint ( ) . to_bytes_le ( ) . as_slice ( ) ,
964964 ) ) ,
965- Self :: Var ( v) => v. to_bytes ( ) ,
965+ Self :: Var ( v) => v. to_bytes_le ( ) ,
966966 }
967967 }
968968
969969 #[ tracing:: instrument( target = "r1cs" ) ]
970- fn to_non_unique_bytes ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
970+ fn to_non_unique_bytes_le ( & self ) -> Result < Vec < UInt8 < F > > , SynthesisError > {
971971 match self {
972972 Self :: Constant ( c) => Ok ( UInt8 :: constant_vec (
973973 c. into_bigint ( ) . to_bytes_le ( ) . as_slice ( ) ,
974974 ) ) ,
975- Self :: Var ( v) => v. to_non_unique_bytes ( ) ,
975+ Self :: Var ( v) => v. to_non_unique_bytes_le ( ) ,
976976 }
977977 }
978978}
0 commit comments