Module keccak

Module keccak 

Source
Expand description

An interpreter for an optimised version of Keccak

Re-exportsยง

pub use column::Absorbs;
pub use column::Sponges;
pub use column::Steps;

Modulesยง

column
This module defines the custom columns used in the Keccak witness, which are aliases for the actual Keccak witness columns also defined here.
constraints
This module contains the constraints for one Keccak step.
environment
This module contains the definition and implementation of the Keccak environment including the common functions between the witness and the constraints environments for arithmetic, boolean, and column operations.
helpers
interpreter
This module defines the Keccak interpreter in charge of triggering the Keccak workflow
witness
This file contains the witness for the Keccak hash function for the zkVM project. It assigns the witness values to the corresponding columns of KeccakWitness in the environment.

Enumsยง

Constraint
All the names for constraints involved in the Keccak circuit
Error
Errors that can occur during the check of the witness

Constantsยง

HASH_BITLENGTH ๐Ÿ”’
Desired output length of the hash in bits
HASH_BYTELENGTH ๐Ÿ”’
Desired output length of the hash in bytes
WORDS_IN_HASH ๐Ÿ”’
Number of words that fit in the hash digest
WORD_LENGTH_IN_BITS ๐Ÿ”’
Length of each word in the Keccak state, in bits
ZKVM_KECCAK_COLS_CURR ๐Ÿ”’
Number of columns required in the curr part of the witness
ZKVM_KECCAK_COLS_NEXT ๐Ÿ”’
Number of columns required in the next part of the witness, corresponding to the output length

Functionsยง

grid_index ๐Ÿ”’
pad_blocks
This function returns a vector of field elements that represent the 5 padding suffixes. The first one uses at most 12 bytes, and the rest use at most 31 bytes.
standardize
Standardizes a Keccak step to a common opcode