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

Go to the source code of this file.

Typedefs

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

Functions

std::vector< field_ctpack_bytes_into_field_elements (const byte_array_ct &input, size_t num_bytes_in_chunk=4)
 Given a byte_array object, slice it into chunks of size num_bytes_in_chunk and compute field elements reconstructed from these chunks.
 
constexpr uint64_t ror (uint64_t val, uint64_t shift)
 
std::array< uint64_t, 64 > extend_witness (std::array< uint64_t, 16 > &in)
 
std::array< uint64_t, 8 > inner_block (std::array< uint64_t, 64 > &w)
 
 TEST (stdlib_sha256, test_plookup_55_bytes)
 
 TEST (stdlib_sha256, test_55_bytes)
 
 TEST (stdlib_sha256, test_NIST_vector_one_byte_array)
 
 TEST (stdlib_sha256, test_NIST_vector_one)
 
 TEST (stdlib_sha256, test_NIST_vector_two)
 
 TEST (stdlib_sha256, test_NIST_vector_three)
 
 TEST (stdlib_sha256, test_NIST_vector_four)
 
 HEAVY_TEST (stdlib_sha256, test_NIST_vector_five)
 
 TEST (stdlib_sha256, test_input_len_multiple)
 
 TEST (stdlib_sha256, test_input_str_len_multiple)
 
 TEST (stdlib_sha256, test_boomerang_value_regression)
 

Typedef Documentation

◆ Builder

Definition at line 18 of file sha256.test.cpp.

◆ byte_array_ct

Definition at line 20 of file sha256.test.cpp.

◆ field_ct

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

◆ witness_ct

Definition at line 22 of file sha256.test.cpp.

Function Documentation

◆ extend_witness()

std::array< uint64_t, 64 > extend_witness ( std::array< uint64_t, 16 > &  in)

Definition at line 46 of file sha256.test.cpp.

◆ HEAVY_TEST()

HEAVY_TEST ( stdlib_sha256  ,
test_NIST_vector_five   
)

Definition at line 336 of file sha256.test.cpp.

◆ inner_block()

std::array< uint64_t, 8 > inner_block ( std::array< uint64_t, 64 > &  w)

Add into previous block output and return

Definition at line 73 of file sha256.test.cpp.

◆ pack_bytes_into_field_elements()

std::vector< field_ct > pack_bytes_into_field_elements ( const byte_array_ct input,
size_t  num_bytes_in_chunk = 4 
)

Given a byte_array object, slice it into chunks of size num_bytes_in_chunk and compute field elements reconstructed from these chunks.

Definition at line 29 of file sha256.test.cpp.

◆ ror()

constexpr uint64_t ror ( uint64_t  val,
uint64_t  shift 
)
constexpr

Definition at line 41 of file sha256.test.cpp.

◆ TEST() [1/10]

TEST ( stdlib_sha256  ,
test_55_bytes   
)

Definition at line 189 of file sha256.test.cpp.

◆ TEST() [2/10]

TEST ( stdlib_sha256  ,
test_boomerang_value_regression   
)

Definition at line 437 of file sha256.test.cpp.

◆ TEST() [3/10]

TEST ( stdlib_sha256  ,
test_input_len_multiple   
)

Definition at line 373 of file sha256.test.cpp.

◆ TEST() [4/10]

TEST ( stdlib_sha256  ,
test_input_str_len_multiple   
)

Definition at line 393 of file sha256.test.cpp.

◆ TEST() [5/10]

TEST ( stdlib_sha256  ,
test_NIST_vector_four   
)

Definition at line 310 of file sha256.test.cpp.

◆ TEST() [6/10]

TEST ( stdlib_sha256  ,
test_NIST_vector_one   
)

Definition at line 236 of file sha256.test.cpp.

◆ TEST() [7/10]

TEST ( stdlib_sha256  ,
test_NIST_vector_one_byte_array   
)

Definition at line 214 of file sha256.test.cpp.

◆ TEST() [8/10]

TEST ( stdlib_sha256  ,
test_NIST_vector_three   
)

Definition at line 285 of file sha256.test.cpp.

◆ TEST() [9/10]

TEST ( stdlib_sha256  ,
test_NIST_vector_two   
)

Definition at line 261 of file sha256.test.cpp.

◆ TEST() [10/10]

TEST ( stdlib_sha256  ,
test_plookup_55_bytes   
)

Definition at line 163 of file sha256.test.cpp.