.. index:: single: fips202_hash(RateBytes,Suffix,OutputBytes)
.. _fips202_hash/3:

.. rst-class:: right

**object**

``fips202_hash(RateBytes,Suffix,OutputBytes)``
==============================================

Common implementation of the standardized FIPS 202 SHA-3 and SHAKE variants using the Keccak-f[1600] permutation.

| **Availability:** 
|    ``logtalk_load(hashes(loader))``

| **Author:** Paulo Moura
| **Version:** 1:2:0
| **Date:** 2026-07-16

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Implements:**
|    ``public`` :ref:`hash_state_protocol <hash_state_protocol/0>`
| **Uses:**
|    :ref:`hash_common_32 <hash_common_32/0>`
|    :ref:`hash_common_64 <hash_common_64/0>`
|    :ref:`list <list/0>`

| **Remarks:**
|    (none)

| **Inherited public predicates:**
|     :ref:`hash_state_protocol/0::final_hash_state/2`  :ref:`hash_protocol/0::hash/2`  :ref:`hash_state_protocol/0::new_hash_state/1`  :ref:`hash_state_protocol/0::update_hash_state/3`  

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

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

(no local declarations; see entity ancestors if any)

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

.. index:: absorb/2
.. _fips202_hash/3::absorb/2:

``absorb/2``
^^^^^^^^^^^^

Absorbs the input bytes into the Keccak state and returns the resulting state after the final padded block permutation.

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

| **Template:**
|    ``absorb(Bytes,State)``
| **Mode and number of proofs:**
|    ``absorb(+list(byte),--list(integer))`` - ``one``


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

.. index:: squeeze/3
.. _fips202_hash/3::squeeze/3:

``squeeze/3``
^^^^^^^^^^^^^

Squeezes the requested number of output bytes from a Keccak state.

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

| **Template:**
|    ``squeeze(State,OutputBytes,DigestBytes)``
| **Mode and number of proofs:**
|    ``squeeze(+list(integer),+integer,--list(byte))`` - ``one``


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

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

(no local declarations; see entity ancestors if any)

Operators
---------

(none)

