|
@ -920,7 +920,7 @@ impl ToBytesGadget for FpVar { |
|
|
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 ToBytesGadget for FpVar { |
|
|
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(),
|
|
|
}
|
|
|
}
|
|
|