protocol

hash_digest_protocol

Protocol for fixed-size cryptographic hash functions exposing raw digests and digest metadata.

Availability:
logtalk_load(hashes(loader))
Author: Paulo Moura
Version: 1:1:0
Date: 2026-10-12
Compilation flags:
static
Extends:
Remarks:
(none)
Inherited public predicates:

Public predicates

digest/2

Computes the digest for a list of bytes and returns it as a list of bytes.

Compilation flags:
static
Template:
digest(Bytes,Digest)
Mode and number of proofs:
digest(+list(byte),--list(byte)) - one_or_error
Exceptions:
The key or digest size is not sufficiently instantiated::
instantiation_error
The digest size is invalid for BLAKE2::
domain_error(blake2_digest_size,DigestSize)
The key is ground but invalid for BLAKE2::
domain_error(blake2_key,Key)

digest_size/1

Returns the digest size in bytes.

Compilation flags:
static
Template:
digest_size(DigestSize)
Mode and number of proofs:
digest_size(--integer) - one_or_error
Exceptions:
The key or digest size is not sufficiently instantiated::
instantiation_error
The digest size is invalid for BLAKE2::
domain_error(blake2_digest_size,DigestSize)
The key is ground but invalid for BLAKE2::
domain_error(blake2_key,Key)

block_size/1

Returns the hash block size in bytes.

Compilation flags:
static
Template:
block_size(BlockSize)
Mode and number of proofs:
block_size(--integer) - one_or_error
Exceptions:
The key or digest size is not sufficiently instantiated::
instantiation_error
The digest size is invalid for BLAKE2::
domain_error(blake2_digest_size,DigestSize)
The key is ground but invalid for BLAKE2::
domain_error(blake2_key,Key)

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)