oa::crypto::hash
Module published by the oa::crypto module.
MdRust public API
Public Functions
Function Documentation
Apply Keccak-f[1600] independently to every 200-byte row. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.
Build selected SHAKE-256 Merkle inclusion proofs entirely on the device. leaves is U8 [leaf_count, 32]; indices is rank-one U32. Output is U8 [proof_count, 16 + depth * 32]. The little-endian four-word header is [version=1, leaf_count, leaf_index, valid], followed by siblings bottom-up. Out-of-range device indices set valid=0 and zero every sibling. Empty selections return ready empty storage. No host observation of indices occurs. Errors Rejects metadata, ownership, address limits, allocation or recording failures.
Reduce any non-empty batch of 32-byte leaf hashes to one Merkle root. Duplicates the final node of each odd level, matching the OA CPU tree. Errors Rejects invalid shapes, dtypes, shader address limits, allocation or recording failures.
Apply the pinned Plonky3 babybear16 Poseidon2 field sponge. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 babybear16 Poseidon2 permutation. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 babybear24 Poseidon2 field sponge. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 babybear24 Poseidon2 permutation. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 koalabear16 Poseidon2 field sponge. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 koalabear16 Poseidon2 permutation. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 koalabear24 Poseidon2 field sponge. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Apply the pinned Plonky3 koalabear24 Poseidon2 permutation. U32 rows contain field elements, reduced modulo the named prime. The OA sponge has capacity eight and explicit length/domain framing. It is not a claim of NVIDIA sponge wire compatibility. Errors Rejects dtype, rank, width, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA224. Returns exact 28-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA256. Returns exact 32-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA384. Returns exact 48-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA3-224. Returns exact 28-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA3-256. Returns exact 32-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA3-384. Returns exact 48-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA3-512. Returns exact 64-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA512. Returns exact 64-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA-512/224. Returns exact 28-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
Hash each U8 [batch, message_bytes] row with SHA-512/256. Returns exact 32-byte digest rows without padding. Empty messages are valid. Records device work without a host wait. Ordinary Matrix storage is public data; secret-bearing hashing requires the separate secret execution boundary. Errors Rejects invalid rank, dtype, batch size, address limits, allocation or recording failures.
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.
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.
Verify version-one SHAKE-256 inclusion proof frames on the device. Leaves are U8 [proof_count, 32]; proofs have the frame layout returned by leaf_count must come from trusted tree metadata, not the proof header. merkle_proofs. Roots are U8 [1, 32] or [proof_count, 32]. Return rank-one U32 flags, exactly zero or one per row. Malformed headers, indices, duplicate-last paths, tampered leaves or roots return zero. Empty batches return ready empty storage; no input content is read on the host. Errors Rejects metadata, ownership, address limits, allocation or recording failures.