Electron-Labs / ed25519-circom

ED25519 implementation in Circom

Home Page:https://docs.electronlabs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in binary adder logic

rahulghangas opened this issue · comments

Last bit only gets the carry value, and the last bits of the inputs are never added.

https://github.com/Electron-Labs/circom-binary-ops/blob/5e435b35792707de2dfcc7d8bb6239f97edbf7f7/binary_adder.circom#L84

Are the inputs intended to be 1 bit bigger than the number that we're adding (to keep track if there's an overflow)? If yes, there should a constraint for that. If not, maybe we can make the output 1 bit bigger to keep track of the overflow.

Alternatively, we can ignore overflow and the user who's instantiating the template can provide inputs with an extra bit