penumbra-zone / decaf377

decaf377 is a prime-order group designed for use in SNARKs over BLS12-377
https://protocol.penumbra.zone/main/crypto/decaf377.html
12 stars 12 forks source link

refactor: pub visibility modifier #95

Closed TalDerei closed 5 months ago

TalDerei commented 7 months ago

This is required, otherwise the monorepo will complain about some wrapper functions being private associated functions.

TalDerei commented 7 months ago

I kept to_le_limbs and from_le_limbs exposed. In the monorepo, we call Fq::from_le_limbs(hash.inner) where the input type is [u64::MAX; 4]. Isn't exposing from_le_limbs necessary in this case?

cronokirby commented 7 months ago

We absolutely do not want to allow doing that, instead, we should use the Fq::SENTINEL value

redshiftzero commented 6 months ago

We realized while modifying poseidon377 to work in embedded environments (ref: https://github.com/penumbra-zone/poseidon377/pull/53) that we'll need Fq::from_montgomery_limbs to be pub in order to instantiate Fq constants. Upon discussion in Discord with @cronokirby it makes sense to add a disclaimer to the Fq::from_montgomery_limb methods that this should not be used unless you are familiar with the internals of the library (done in #98).

TalDerei commented 5 months ago

closing in favor of #98