## std::crypto::hashes::keccak256
| Procedure | Description |
| ----------- | ------------- |
| hash_memory | Computes Keccak256 hash of data stored in memory.<br /><br />Input: [ptr, len_bytes, ...]<br />Output: [DIGEST_U32[8], ...]<br /><br />Where:<br />- ptr: word-aligned memory address containing INPUT_U32[len_u32] where len_u32=⌈len_bytes/4⌉<br />- len_bytes: number of bytes to hash<br />- INPUT_U32[len_u32] ~ INPUT_U8[len_bytes] with u32 packing (unused bytes in final u32 must be 0)<br />- DIGEST_U32[8] = [d_0, ..., d_7] = Keccak256(INPUT_U8[len_bytes])<br /> |
| hash_1to1 | Computes Keccak256 hash of a single 256-bit input.<br /><br />Input: [INPUT_U32[8], ...]<br />Output: [DIGEST_U32[8], ...]<br /><br />Where<br />- DIGEST_U32[8] = [d_0, ..., d_7] = Keccak256(INPUT_U8[32])<br />- INPUT_U32[8] = [i_0, ..., i_7] = [INPUT_LO, INPUT_HI] ~ INPUT_U8[32] with u32 packing<br /> |
| hash_2to1 | Merges two 256-bit digests via Keccak256 hash.<br /><br />Input: [INPUT_L_U32[8], INPUT_R_U32[8], ...]<br />Output: [DIGEST_U32[8], ...]<br /><br />Where<br />- INPUT_L_U32[8] = [l_0, ..., l_7] = [INPUT_L_LO, INPUT_L_HI] ~ INPUT_L_U8[32]<br />- INPUT_R_U32[8] = [r_0, ..., r_7] = [INPUT_R_LO, INPUT_R_HI] ~ INPUT_R_U8[32]<br />- DIGEST_U32[8] = [d_0, ..., d_7] = Keccak256(INPUT_L_U8[32] \|\| INPUT_R_U8[32])<br /> |
| hash_memory_impl | Internal implementation of memory-based Keccak256 computation via deferred computation.<br /><br />Emits an event to populate the advice stack with digest and store the preimage for deferred verification.<br />Returns the commitment to the precompile call and its tag.<br /><br />Input: [ptr, len_bytes, ...]<br />Output: [COMM, TAG, DIGEST_U32[8], ...]<br /><br />Where:<br />- ptr: word-aligned memory address containing INPUT_U32[len_u32] where len_u32=⌈len_bytes/4⌉<br />- len_bytes: number of bytes to hash<br />- COMM: the calldata commitment `Rpo256(Rpo256(INPUT_U32[..]) \|\| Rpo256(DIGEST_U32[..]))` consumed by `log_precompile`<br />- TAG = [KECCAK_HASH_MEMORY_EVENT, len_bytes, 0, 0] encodes the precompile identifier and the byte length as metadata<br />- DIGEST_U32[8] = [d_0, ..., d_7] = Keccak256(INPUT_U8[len_bytes])<br /> |