Keccak proof
This implementation of Stark was taken from mir-protocol respectively LogicStark, KeccakSpongeStark. Keccak proof via zk-STARKs enables efficient verification of permutations as a part of building Keccak hashes that included in Patricia Merkle Trie and connect with other STARKs as Logic, KeccakSponge, Data while proving using CTL's.
Circuit
Private inputs include data fields about each value:
inputincludes bytes for hashing
Columns that are used in trace rows generation:
START_PREIMAGEare used to hold the original input to a permutation, i.e. the input to the first round.START_Ato store the input for a permutation.START_Care used to hold xor(A[x, 0], A[x, 1], A[x, 2], A[x, 3], A[x, 4]) operationSTART_C_PRIMEare used to hold xor(C[x, z], C[x - 1, z], C[x + 1, z - 1]) operationSTART_A_PRIMEare used to hold xor(A[x, y], C[x - 1], ROT(C[x + 1], 1)) operationSTART_A_PRIME_PRIMEare used to hold xor(B[x, y], and (B[x + 1, y], B[x + 2, y])) operationSTART_A_PRIME_PRIME_0_0_BITSis similar toSTART_A_PRIME_PRIME, this element is used for bit-level operations.REG_A_PRIME_PRIME_PRIME_0_0_LOare used to hold lower bits ofSTART_A_PRIME_PRIME_0_0_BITSREG_A_PRIME_PRIME_PRIME_0_0_HIare used to hold higher bits ofSTART_A_PRIME_PRIME_0_0_BITSREG_FILTERis a register which indicates if a row should be included in the CTL. Should be 1 only for certain rows which are final steps, i.e. withreg_step(23) = 1
Constraints
The Keccak Stark aims to constrain the following aspects:
The
REG_FILTERmust be 0 or 1 and if this is not the final step, theREG_FILTERmust be off.If this is not the final step, the local and next preimages must match.
Check that the input limbs are consistent with A' and D.
Enforce that previous round’s output equals the next round’s input.
ctl_keccak() function to prove that concatenation columns of xored_rate_u32s, original_capacity_u32s, updated_state_u32s in KeccakSpongeStark equal to concatenated permutation input and output in KeccakStark.
Last updated