.. index:: single: hash_digest_protocol
.. _hash_digest_protocol/0:

.. rst-class:: right

**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:0:0
| **Date:** 2026-04-16

| **Compilation flags:**
|    ``static``


| **Extends:**
|    ``public`` :ref:`hash_protocol <hash_protocol/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`hash_protocol/0::hash/2`  

.. contents::
   :local:
   :backlinks: top

Public predicates
-----------------

.. index:: digest/2
.. _hash_digest_protocol/0::digest/2:

``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``


------------

.. index:: digest_size/1
.. _hash_digest_protocol/0::digest_size/1:

``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``


------------

.. index:: block_size/1
.. _hash_digest_protocol/0::block_size/1:

``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``


------------

Protected predicates
--------------------

(no local declarations; see entity ancestors if any)

Private predicates
------------------

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

