gblake3

Values

pub fn derive_key(
  key_material km: BitArray,
  context context: String,
) -> BitArray

Derives a 32 byte key from the given key material and context string.

The context string should be globally unique and application specific

Should not be used for passwords since BLAKE3 is not a password hash

pub fn derive_key_from_strings(
  key_material km: String,
  context context: String,
) -> BitArray

Derives a 32 byte key from the given key material and context string.

The context string should be globally unique and application specific

Should not be used for passwords since BLAKE3 is not a password hash

pub fn derive_key_with_length(
  key_material km: BitArray,
  context context: String,
  length l: Int,
) -> BitArray

Derives a key of the provided length from the given key material and context string.

The context string should be globally unique and application specific

Should not be used for passwords since BLAKE3 is not a password hash

pub fn hash(message b: BitArray) -> BitArray

Hashes the given message to a 32 byte array

pub fn hash_string(message s: String) -> BitArray

Hashes the provided message to a 32 bytes array

pub fn hash_string_to_length(
  message s: String,
  output_length_bytes l: Int,
) -> BitArray

Hashes the provided message to the provided number of bytes

pub fn hash_to_length(
  message b: BitArray,
  output_length_bytes l: Int,
) -> BitArray

Hashes the given message to the provided number of bytes

pub fn keyed_hash(
  message b: BitArray,
  key k: BitArray,
) -> Result(BitArray, Nil)

Derives a message hash using the given key as an IV.

Errors if key is not exactly 32 bytes long

pub fn keyed_hash_to_length(
  message b: BitArray,
  key k: BitArray,
  length l: Int,
) -> Result(BitArray, Nil)
Search Document