28static uint32_t bytes_to_uint32(
const uint8_t* bytes)
30 return (
static_cast<uint32_t
>(bytes[0]) << 24) | (
static_cast<uint32_t
>(bytes[1]) << 16) |
31 (
static_cast<uint32_t
>(bytes[2]) << 8) |
static_cast<uint32_t
>(bytes[3]);
37 constexpr size_t SHA256_BLOCK_INPUT_SIZE = 96;
38 if (Size < SHA256_BLOCK_INPUT_SIZE) {
43 std::array<uint32_t, 8> h_init_native;
44 for (
size_t i = 0; i < 8; i++) {
45 h_init_native[i] = bytes_to_uint32(Data + i * 4);
50 for (
size_t i = 0; i < 16; i++) {
51 block_native[i] = bytes_to_uint32(Data + 32 + i * 4);
62 for (
size_t i = 0; i < 8; i++) {
67 for (
size_t i = 0; i < 16; i++) {
78 for (
size_t i = 0; i < 8; i++) {
79 uint32_t circuit_val =
static_cast<uint32_t
>(
uint256_t(circuit_output[i].get_value()));
80 assert(circuit_val == expected_output[i]);
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
static std::array< field_ct, 8 > sha256_block(const std::array< field_ct, 8 > &h_init, const std::array< field_ct, 16 > &input)
Apply the SHA-256 compression function to a single 512-bit message block.
std::array< uint32_t, 8 > sha256_block(const std::array< uint32_t, 8 > &h_init, const std::array< uint32_t, 16 > &input)
SHA-256 compression function (FIPS 180-4 Section 6.2.2)
Entry point for Barretenberg command-line interface.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)