#include <bytecode_hashing.hpp>
Definition at line 14 of file bytecode_hashing.hpp.
◆ BytecodeHasher()
◆ assert_public_bytecode_commitment()
| void bb::avm2::simulation::BytecodeHasher::assert_public_bytecode_commitment |
( |
const BytecodeId & |
bytecode_id, |
|
|
const std::vector< uint8_t > & |
bytecode |
|
) |
| |
|
overridevirtual |
Verify that the given bytecode_id matches the expected bytecode commitment which is a Poseidon2 hash of the bytecode prepended by metadata information.
Encodes the bytecode as field elements, prepends a domain-separated length field, and hashes via Poseidon2. Asserts the result matches the expected bytecode_id and emits a BytecodeHashingEvent for tracegen.
- Parameters
-
| bytecode_id | Unique identifier for this bytecode in the trace (commitment value). |
| bytecode | Raw bytecode bytes to hash. |
- Exceptions
-
| Assertion | failure if the computed hash does not match bytecode_id. |
Implements bb::avm2::simulation::BytecodeHashingInterface.
Definition at line 24 of file bytecode_hashing.cpp.
◆ events
◆ hasher
The documentation for this class was generated from the following files: