mirror of
https://github.com/arnaucube/ark-r1cs-std.git
synced 2026-01-08 15:01:29 +01:00
convert nonnative constant to little endian (#127)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
## Pending
|
||||
- [\#117](https://github.com/arkworks-rs/r1cs-std/pull/117) Fix result of `precomputed_base_scalar_mul_le` to not discard previous value.
|
||||
- [\#124](https://github.com/arkworks-rs/r1cs-std/pull/124) Fix `scalar_mul_le` constraints unsatisfiability when short Weierstrass point is zero.
|
||||
- [\#127](https://github.com/arkworks-rs/r1cs-std/pull/127) Convert `NonNativeFieldVar` constants to little-endian bytes instead of big-endian (`ToBytesGadget`).
|
||||
|
||||
### Breaking changes
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ impl<TargetField: PrimeField, BaseField: PrimeField> ToBytesGadget<BaseField>
|
||||
fn to_bytes(&self) -> R1CSResult<Vec<UInt8<BaseField>>> {
|
||||
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(),
|
||||
@@ -324,7 +324,7 @@ impl<TargetField: PrimeField, BaseField: PrimeField> ToBytesGadget<BaseField>
|
||||
fn to_non_unique_bytes(&self) -> R1CSResult<Vec<UInt8<BaseField>>> {
|
||||
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(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user