Expand description
Implementation of Different non-linear Gates used in SHA-2 family of circuits as described in NIST SP-180-4 https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf
Structs§
- ChGate
- Multiplexer gate as defined by SHA-2 family of circuits.
- Const
Input Gate - Represents a constant input to the circuit. Unlike other gates, the ConstInputGate takes as input a name for the constant and its value and creates an input shred as well the MLE of input data that can be bound to the circuit at a later time.
- MajGate
- Bitwise majority selector gate as defined by SHA-2 family of Hash functions.
- Sigma
- The capital Sigma function described on Printed Page Number 10 in NIST SP-180.4. The const parameters ROTR1, ROTR2, ROTR3 denote the rotations defined in NIST spec. Bits are assumed to be in MSB first decomposition form.
- Small
Sigma - The Small Sigma function described on Printed Page Number 10 in NIST SP-180.4. The const parameters have following meaning ROTR1 : Value of rotation in first ROTR ROTR2 : Value of rotation in second ROTR SHR3 : Value of rotation in third SHR MSB-first bit decomposition required.
Traits§
- IsBit
Decomposable - A trait to deal with bit decomposition and bit rotation as needed by SHA-2 family of hash functions.
Functions§
- bit_
decompose_ lsb_ first - Decompose a numerical type in bits: LSB first
- bit_
decompose_ msb_ first - Decompose a numerical type in bits: MSB first
- sha_
words_ 🔒2_ num_ vars