oa::cryptography::hash

Module published by the oa::cryptography module.

MdRust public API

Public Functions

pub fn keccak_f1600(input: &Matrix) -> Result<Matrix>
pub fn merkle_root(input: &Matrix) -> Result<Matrix>
pub fn shake128(input: &Matrix, output_length: usize) -> Result<Matrix>
pub fn shake256(input: &Matrix, output_length: usize) -> Result<Matrix>

Function Documentation

pub fn keccak_f1600( input: &Matrix ) -> Result<Matrix>
Apply Keccak-f[1600] independently to every 200-byte row. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.
pub fn merkle_root( input: &Matrix ) -> Result<Matrix>
Reduce 32-byte leaf hashes to one Merkle root. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.
pub fn shake128( input: &Matrix, output_length: usize ) -> Result<Matrix>
Hash every row with SHAKE-128. An output_length of zero selects 16 bytes. Output rows are padded to an eight-byte boundary, matching the OA donor ABI. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.
pub fn shake256( input: &Matrix, output_length: usize ) -> Result<Matrix>
Hash every row with SHAKE-256. An output_length of zero selects 32 bytes. Output rows are padded to an eight-byte boundary, matching the OA donor ABI. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.