3#include "gmock/gmock.h"
5#include <gtest/gtest.h>
24using ::testing::AllOf;
25using ::testing::ElementsAre;
26using ::testing::Field;
27using ::testing::Return;
28using ::testing::SizeIs;
29using ::testing::StrictMock;
35class BytecodeHashingTest :
public ::testing::Test {
46TEST_F(BytecodeHashingTest, SimpleHash)
49 FF hash =
FF(
"0x16d621c3387156ef53754679e7b2c9be8f0bceeb44aa59a74991df3b0b42a0bf");
51 std::vector<FF> bytecode_fields = {};
52 for (uint32_t i = 1; i < 100; i++) {
53 bytecode_fields.push_back(
FF(i));
56 std::vector<uint8_t> bytecode = {};
57 for (
auto bytecode_field : bytecode_fields) {
60 bytecode.insert(bytecode.end(), bytes.begin() + 1, bytes.end());
76TEST_F(BytecodeHashingTest, Hash)
81 prepended_bytecode_fields.insert(prepended_bytecode_fields.end(), bytecode_fields.begin(), bytecode_fields.end());
#define GENERATOR_INDEX__PUBLIC_BYTECODE
BytecodeHasher bytecode_hasher
EventEmitter< BytecodeHashingEvent > hashing_events
void assert_public_bytecode_commitment(const BytecodeId &bytecode_id, const std::vector< uint8_t > &bytecode, const FF &public_bytecode_commitment) override
static FF hash(const std::vector< FF > &input)
Hashes a vector of field elements.
void hash(State &state) noexcept
std::vector< FF > encode_bytecode(std::span< const uint8_t > bytecode)
std::vector< uint8_t > random_bytes(size_t n)
TEST_F(IPATest, ChallengesAreZero)
std::vector< uint8_t > to_buffer(T const &value)
std::vector< FF > bytecode_fields