zkcrypto / ff

Traits and utilities for working with finite fields.
Apache License 2.0
236 stars 101 forks source link

`PrimeField::Repr` ambiguous endianness #106

Open jonathanpwang opened 1 year ago

jonathanpwang commented 1 year ago

It is unsafe in downstream use cases for PrimeField::to_repr and PrimeField::from_repr to have ambiguous endianness. (E.g., it's oftentimes hard to implement something for ff::PrimeField without assuming something about endianness.)

Can you either add an ENDIANNESS const or functions like to_bytes_le and from_bytes_le?