privacy-scaling-explorations / halo2

https://privacy-scaling-explorations.github.io/halo2/
Other
201 stars 121 forks source link

`FromUniformBytes<64>` may not be fitting for large fields. #324

Open davidnevadoc opened 4 months ago

davidnevadoc commented 4 months ago

ATM FromUniformBytes<64> is required in several parts of the codebase, mainly in the backend.

The trait description states:

/// For security, `N` must be chosen so that `N * 8 >= Self::NUM_BITS + 128`. A larger
/// value of `N` may be chosen for convenience; for example, for a field with a 255-bit
/// modulus, `N = 64` is convenient as it matches the output length of several common
/// cryptographic hash functions (such as SHA-512 and BLAKE2b).

Consequently, this is fine for most fields but may be an issue for large ones. see: https://github.com/privacy-scaling-explorations/halo2curves/pull/146#discussion_r1562381113