You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Falcon signature verification algorithm relies heavily on modular arithmetic with respect to the prime $12289$. The current implementation rpo_falcon512::mod_12289 is very inefficient since it uses u64_div underneath. A more optimized implementation should, in addition to using non-determinism, take into account the fact that $12289$ is less than $2^{32} - 1$.
The text was updated successfully, but these errors were encountered:
One other thing to consider: would it make sense to add a native instruction which can do a modular reduction in a single VM cycle. The instruction could work like this:
Inputs: [v, p, ...]
Outputs: [r, p, ...]
Where:
$v$ is the value to be reduced - could be any field element.
$p$ is the modulus which must be a u32 value.
$r = v % p$.
It probably doesn't make sense to add it solely for the purposes of Falcon signature, but if it could be used to speed up other things (e.g., ECDSA signature verification), then it might be worth it.
Also, I'm not sure how complex the constraints for this instruction would be - so, maybe not viable to begin with.
We have managed to improve the implementation of the Falcon signature verification by limiting the number of modular reductions in the first place in #1623 . So we can safely close this issue.
The Falcon signature verification algorithm relies heavily on modular arithmetic with respect to the prime$12289$ . The current implementation $12289$ is less than $2^{32} - 1$ .
rpo_falcon512::mod_12289
is very inefficient since it usesu64_div
underneath. A more optimized implementation should, in addition to using non-determinism, take into account the fact thatThe text was updated successfully, but these errors were encountered: