Expand description
This module includes the definition of the NOT gadget and the witness code generation,
for both the implementation running with Xor16
gates and the one with Generic
gates.
Note that this module does not include a Not
gate type.
Functionsยง
- extend_
not_ witness_ checked_ length - Extend a NOT witness for less than 255 bits (native field)
Input: full witness, first input and optional bit length
If
bits
is not provided, the negation is performed using the length of theinput
in bits. Ifbits
is provided, the negation takes the maximum length betweenbits
and that ofinput
. Warning: - extend_
not_ witness_ unchecked_ length - Extends negation witnesses from generic gate, assuming the input witness already contains
public input rows holding the 2^bits-1 value.
Input: a vector of words to be negated, and the number of bits (all the same)
Returns error if the bits length is too small for the inputs
Warning: Set public input of bits in public generic gate
Note:
witness[0][pub] = 2^bits - 1