|
Botan 3.10.0
Crypto and TLS for C&
|
#include <keccak_perm.h>
Classes | |
| struct | Config |
Public Types | |
| using | state_t |
| using | word_t |
Public Member Functions | |
| size_t & | _cursor () |
| void | absorb (std::span< const uint8_t > input) |
| Absorb input data into the Keccak sponge. | |
| constexpr size_t | bit_capacity () const |
| constexpr size_t | bit_rate () const |
| constexpr size_t | byte_capacity () const |
| constexpr size_t | byte_rate () const |
| void | clear () |
| size_t | cursor () const |
| void | finish () |
| Add final padding (as provided in the constructor) and permute. | |
| constexpr | Keccak_Permutation (Config config) |
| Instantiate a Keccak permutation. | |
| void | permute () |
| std::string | provider () const |
| void | squeeze (std::span< uint8_t > output) |
| Expand output data from the current Keccak state. | |
| constexpr auto & | state () |
Static Public Member Functions | |
| static constexpr size_t | state_bits () |
| static constexpr size_t | state_bytes () |
Static Public Attributes | |
| static constexpr size_t | word_bits |
| static constexpr size_t | word_bytes |
Protected Member Functions | |
| void | reset_cursor () |
KECCAK FIPS
This file implements Keccak[c] which is specified by NIST FIPS 202 [1], where "c" is the variable capacity of this hash primitive. Keccak[c] is not a general purpose hash function, but used as the basic primitive for algorithms such as SHA-3 and KMAC. This is not to be confused with the "informal" general purpose hash function which is referred to as "Keccak" and apparently refers to the final submission version of the Keccak submission in the SHA-3 contest, possibly what is released by NIST under the name "KECCAK - Final Algorithm Package" [2]. See also the file keccak.h for the details how the keccak hash function is defined in terms of the Keccak[c] – a detail which cannot be found in [1].
[1] FIPS PUB 202 – FEDERAL INFORMATION PROCESSING STANDARDS PUBLICATION – SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf#page=28 [2] https://csrc.nist.gov/projects/hash-functions/sha-3-project
Definition at line 55 of file keccak_perm.h.
|
inherited |
|
inherited |
|
inlineexplicitconstexpr |
Instantiate a Keccak permutation.
| config | Keccak parameter configuration |
Definition at line 68 of file keccak_perm.h.
References Botan::Keccak_Permutation::Config::capacity_bits, Botan::Sponge< 25, uint64_t >::Sponge(), and Botan::Sponge< 25, uint64_t >::state_bits().
|
inlineinherited |
Definition at line 60 of file sponge.h.
| void Botan::Keccak_Permutation::absorb | ( | std::span< const uint8_t > | input | ) |
Absorb input data into the Keccak sponge.
This method can be called multiple times with arbitrary-length buffers.
| input | the input data |
Definition at line 38 of file keccak_perm.cpp.
References Botan::absorb_into_sponge().
|
inlineconstexprinherited |
|
inlineconstexprinherited |
|
inlineconstexprinherited |
Definition at line 54 of file sponge.h.
|
inlineconstexprinherited |
| void Botan::Keccak_Permutation::clear | ( | ) |
Definition at line 33 of file keccak_perm.cpp.
References Botan::Sponge< 25, uint64_t >::reset_cursor(), and Botan::Sponge< 25, uint64_t >::state().
|
inlineinherited |
| void Botan::Keccak_Permutation::finish | ( | ) |
Add final padding (as provided in the constructor) and permute.
Definition at line 46 of file keccak_perm.cpp.
References BOTAN_DEBUG_ASSERT, Botan::Sponge< 25, uint64_t >::byte_rate(), Botan::Sponge< 25, uint64_t >::cursor(), permute(), Botan::Sponge< 25, uint64_t >::reset_cursor(), Botan::Sponge< 25, uint64_t >::state(), and Botan::Sponge< 25, uint64_t >::word_bytes.
| void Botan::Keccak_Permutation::permute | ( | ) |
The Keccak permutation function
Definition at line 80 of file keccak_perm.cpp.
References Botan::CPUFeature::BMI, Botan::CPUID::has(), Botan::Keccak_Permutation_round(), and Botan::Sponge< 25, uint64_t >::state().
Referenced by finish().
| std::string Botan::Keccak_Permutation::provider | ( | ) | const |
Definition at line 23 of file keccak_perm.cpp.
References Botan::CPUFeature::BMI, and Botan::CPUID::check().
|
inlineprotectedinherited |
Definition at line 63 of file sponge.h.
Referenced by Botan::Keccak_Permutation::clear(), and Botan::Keccak_Permutation::finish().
| void Botan::Keccak_Permutation::squeeze | ( | std::span< uint8_t > | output | ) |
Expand output data from the current Keccak state.
This method can be called multiple times with arbitrary-length buffers.
| output | the designated output memory |
Definition at line 42 of file keccak_perm.cpp.
References Botan::squeeze_from_sponge().
|
inlineconstexprinherited |
Definition at line 56 of file sponge.h.
Referenced by Botan::Keccak_Permutation::clear(), Botan::Keccak_Permutation::finish(), and Botan::Keccak_Permutation::permute().
|
inlinestaticconstexprinherited |
Definition at line 46 of file sponge.h.
Referenced by Botan::Keccak_Permutation::Keccak_Permutation().
|
inlinestaticconstexprinherited |
|
staticconstexprinherited |
|
staticconstexprinherited |
Definition at line 29 of file sponge.h.
Referenced by Botan::Keccak_Permutation::finish().