Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
keccak.fuzzer.cpp File Reference
#include "keccak.hpp"
#include "barretenberg/circuit_checker/circuit_checker.hpp"
#include "barretenberg/crypto/keccak/keccak.hpp"
#include "barretenberg/stdlib_circuit_builders/ultra_circuit_builder.hpp"
#include <array>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <vector>

Go to the source code of this file.

Macros

#define PRINT_STATE(header, bs)
 

Functions

int LLVMFuzzerTestOneInput (const uint8_t *Data, size_t Size)
 Fuzzer for Keccak-f1600 permutation (permutation_opcode)
 

Macro Definition Documentation

◆ PRINT_STATE

#define PRINT_STATE (   header,
  bs 
)

Definition at line 25 of file keccak.fuzzer.cpp.

Function Documentation

◆ LLVMFuzzerTestOneInput()

int LLVMFuzzerTestOneInput ( const uint8_t *  Data,
size_t  Size 
)

Fuzzer for Keccak-f1600 permutation (permutation_opcode)

Tests the circuit implementation of permutation_opcode against the native ethash_keccakf1600. This tests the primitive exposed to ACIR for the keccakf1600 opcode.

Input: 200 bytes representing a Keccak-f1600 state (25 lanes of 64 bits each) The fuzzer:

  1. Interprets input as native Keccak state
  2. Runs native permutation via ethash_keccakf1600
  3. Runs circuit permutation via keccak::permutation_opcode
  4. Asserts both produce identical results
  5. Verifies the circuit is valid

Definition at line 42 of file keccak.fuzzer.cpp.