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 code below adds 2 commitments with the value of 200 using 8 bits as size. 200 + 200 should overflow a u8, this code tries to find what value matches this commitment. Surprisingly (or not), the output I get is 400 which sounds ok since it's 200 + 200 but it is not an u8. Did I understand the 8 bits size wrong?
Hi,
maybe it is not too late to shed some light on this:
The code above adds 2 commitments, both with the value of 200 (yet, I'd suggest not using the same blinding twice), using 8 bits as size parametrizing the proof-system such that 8 bits are used to create intermediate variables --- in other words it can handle inputs <2^8, as it proves statements about the first 8 bit-positions of the inputs.
The actual data type representing a commitment is Scalar, which can hold up to 255-bit integers.
Now, the computation of 200 + 200 does not overflow the large data type, and not surprisingly you find 400 as the correct answer using the enumeration method.
The code below adds 2 commitments with the value of
200
using 8 bits as size.200 + 200
should overflow au8
, this code tries to find what value matches this commitment. Surprisingly (or not), the output I get is400
which sounds ok since it's200 + 200
but it is not anu8
. Did I understand the 8 bits size wrong?The text was updated successfully, but these errors were encountered: