Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
graph_description_sha256.test.cpp File Reference

Go to the source code of this file.

Typedefs

using Builder = UltraCircuitBuilder
 
using field_ct = field_t< Builder >
 
using witness_ct = witness_t< Builder >
 

Functions

template<size_t N>
void fix_field_array (std::array< field_ct, N > &arr)
 Fix witness for an array of field elements.
 
 TEST (boomerang_stdlib_sha256, test_graph_for_sha256_block_single)
 Test SHA256 compression circuit graph analysis (single block)
 
 TEST (boomerang_stdlib_sha256, test_graph_for_sha256_block_chained)
 Test SHA256 compression circuit graph analysis (chained blocks)
 

Typedef Documentation

◆ Builder

Definition at line 11 of file graph_description_sha256.test.cpp.

◆ field_ct

Definition at line 12 of file graph_description_sha256.test.cpp.

◆ witness_ct

Definition at line 13 of file graph_description_sha256.test.cpp.

Function Documentation

◆ fix_field_array()

template<size_t N>
void fix_field_array ( std::array< field_ct, N > &  arr)

Fix witness for an array of field elements.

Static analyzer prints variables that only appear in one gate. By fixing witnesses, we ensure variables appear in at least 2 gates, filtering out false positives.

Definition at line 21 of file graph_description_sha256.test.cpp.

◆ TEST() [1/2]

TEST ( boomerang_stdlib_sha256  ,
test_graph_for_sha256_block_chained   
)

Test SHA256 compression circuit graph analysis (chained blocks)

This test verifies the graph structure when multiple sha256_block calls are chained together, simulating multi-block message hashing.

The test checks that:

  • The circuit consists of exactly 1 connected component
  • No variables appear in only one gate after witness fixing

Definition at line 80 of file graph_description_sha256.test.cpp.

◆ TEST() [2/2]

TEST ( boomerang_stdlib_sha256  ,
test_graph_for_sha256_block_single   
)

Test SHA256 compression circuit graph analysis (single block)

This test verifies the graph structure of a sha256_block circuit. The test checks that:

  • The circuit consists of exactly 1 connected component
  • No variables appear in only one gate after witness fixing

Definition at line 36 of file graph_description_sha256.test.cpp.