Module kimchi::circuits::polynomials::not
source · 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 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: - 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