OpenAgentID documentation
Source referencesRust module referenceopenagent-crypto-wasm

openagent-crypto-wasm · blake3_hash

Declared module signatures, types, configuration, and source documentation.

Source: openagent-sdk/crates/openagent-crypto-wasm/src/blake3_hash.rs. SHA-256: 8ecfbe5691e332d06ec01ba5e08495b7e630e3257697784491a49b54ff511b40.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

blake3_hash::HASH_LEN

BLAKE3 output length in bytes.

pub const HASH_LEN: usize;

Source line: 12.

blake3_hash::KEY_LEN

BLAKE3 keyed-hash key length in bytes.

pub const KEY_LEN: usize;

Source line: 14.

blake3_hash::hash

Computes the BLAKE3 hash of data.

Examples

let h = openagent_crypto_wasm::blake3_hash::hash(b"hello world");
assert_eq!(h.len(), 32);
pub fn hash(data: &[u8]) -> [u8; HASH_LEN];

Source line: 24.

blake3_hash::keyed_hash

Computes the keyed BLAKE3 hash of data under the 32-byte key.

Errors

[CryptoError::InvalidLength] if key is not exactly 32 bytes.

pub fn keyed_hash(key: &[u8], data: &[u8]) -> Result<[u8; HASH_LEN], CryptoError>;

Source line: 33.

blake3_hash::derive_key

Derives a 32-byte key using BLAKE3's key-derivation mode.

context should be a hard-coded ASCII string unique per application/protocol (BLAKE3 KDF best practice).

pub fn derive_key(context: &str, key_material: &[u8]) -> [u8; HASH_LEN];

Source line: 44.

On this page