Module xor

Source
Expand description

This module includes the definition of the XOR gadget for 64, 32, and 16 bits, the definition of the constraints of the Xor16 circuit gate, and the code for witness generation for the XOR gadget.

Structs§

Xor16

Functions§

create_xor_witness
Create a Xor for up to the native length starting at row 0 Input: first input and second input, bits length, current row Panics if the desired bits is smaller than the inputs length
extend_xor_witness
Extends the Xor rows to the full witness Panics if the words are larger than the desired bits
lookup_table
Get the xor lookup table
num_xors
Returns the number of XOR rows needed for inputs of usize bits