aztec-nr - noir_aztec::hash

Function compute_public_bytecode_commitment

pub fn compute_public_bytecode_commitment(packed_public_bytecode: [Field; 3000]) -> Field

Computes the public bytecode commitment for a contract class. The commitment is hash([separator, ...bytecode]) where bytecode omits the length prefix present in packed_bytecode.

@param packed_bytecode - The packed bytecode of the contract class. 0th word is the length in bytes. packed_bytecode is mutable so that we can avoid copying the array to construct one starting with separator instead of length. @returns The public bytecode commitment.