libxcks
0.1.0.1
|
Computes the SHA3-512 hash from a byte stream. More...
#include <keccak.hpp>
Public Member Functions | |
SHA3_512 () | |
Default constructor. More... | |
uint8_t * | getValue (uint8_t *buffer) const override final |
Returns the SHA3-512 hash value in the first 64 bytes of the given address. More... | |
size_t | getSize () const override final |
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method. More... | |
std::string | getName () const override final |
Returns the name of the checksum or the hash algorithm. More... | |
ArrayString | getAltNames () const override final |
Returns the alternative names of the SHA3-512 hash algorithm. More... | |
ChecksumAlgoId | getID () const override final |
Returns an unique identifier for the checksum or the hash algorithm. More... | |
Public Member Functions inherited from libxcks::AbstractKeccakImpl | |
AbstractKeccakImpl ()=delete | |
Disable default constructor. More... | |
AbstractKeccakImpl (const unsigned size, const bool isSHA3Hash=true) | |
Constructs a new Keccak or SHA3 implementation with a hash of size bytes. More... | |
void | reset () override final |
Resets the Keccak hash to initial value. More... | |
void | update (const uint8_t *buf, size_t len) override final |
Updates the Keccak hash with specified array of bytes. More... | |
Public Member Functions inherited from libxcks::ChecksumEx | |
std::string | toString (const bool hexInUpperCase=false) const override |
Returns the hash value has a string. More... | |
Public Member Functions inherited from libxcks::Checksum | |
virtual | ~Checksum () |
Destructor. More... | |
Static Public Member Functions | |
static std::string | getHashName () |
Returns the name of the hash algorithm. More... | |
static ArrayString | getAlternativeNames () |
Returns the alternative names of the SHA3-512 hash algorithm. More... | |
static constexpr ChecksumAlgoId | getIdentifier () |
Returns an unique identifier for the hash algorithm. More... | |
static Checksum * | getNewInstance () |
Gets a new instance of this class. More... | |
Static Public Member Functions inherited from libxcks::Checksum | |
static ArrayString | getAlternativeNames () |
Returns the alternative name(s) of the checksum or the hash algorithm. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from libxcks::AbstractKeccakImpl | |
void | finish () |
Process the remaining bytes in the internal buffer and the usual prolog according to the standard. More... | |
Static Protected Member Functions inherited from libxcks::ChecksumEx | |
static uint32_t | swapOnLE (const uint32_t value) |
Swaps bytes on little endian architectures. More... | |
static uint32_t | swapOnBE (const uint32_t value) |
Swaps bytes on big endian architectures. More... | |
static uint64_t | swapOnLE (const uint64_t value) |
Swaps bytes on little endian architectures. More... | |
static uint64_t | swapOnBE (const uint64_t value) |
Swaps bytes on big endian architectures. More... | |
Protected Attributes inherited from libxcks::AbstractKeccakImpl | |
uint64_t | saved |
The portion of the input message that we didn't consume yet. More... | |
uint64_t | state [SHA3_KECCAK_SPONGE_WORDS] |
Keccak's state in 'words'. More... | |
unsigned | byteIndex |
0..7–the next byte after the set one (starts from 0; 0–none are buffered). More... | |
unsigned | wordIndex |
0..24–the next word to integrate input (starts from 0). More... | |
const unsigned | capacityWords |
The double size of the hash output in words (e.g. 16 for Keccak 512). More... | |
const bool | useSHA3Hash |
true if result is SHA3 hash, false if "original" Keccak hash. More... | |
Static Protected Attributes inherited from libxcks::AbstractKeccakImpl | |
static constexpr unsigned | SHA3_KECCAK_SPONGE_WORDS = (1600 / 8) / sizeof(uint64_t) |
'Words' here refers to uint64_t More... | |
Computes the SHA3-512 hash from a byte stream.
This class is a rewrite in C++ of the Keccak hash computing algorithm present in the SHA3IUF's GitHub repository.
Using this class in very simple:
Use the update method to provide to the class the bytes for computing the hash.
The SHA3-512 hash value can be gotten by two ways:
The SHA3-512 hash computing can be reseted by the reset method.
Definition at line 521 of file keccak.hpp.
|
inline |
Default constructor.
Definition at line 527 of file keccak.hpp.
|
static |
Returns the alternative names of the SHA3-512 hash algorithm.
Definition at line 365 of file keccak.cpp.
|
inlinefinaloverridevirtual |
Returns the alternative names of the SHA3-512 hash algorithm.
Reimplemented from libxcks::Checksum.
Definition at line 563 of file keccak.hpp.
|
inlinestatic |
Returns the name of the hash algorithm.
Definition at line 587 of file keccak.hpp.
|
inlinefinaloverridevirtual |
Returns an unique identifier for the checksum or the hash algorithm.
Implements libxcks::Checksum.
Definition at line 577 of file keccak.hpp.
|
inlinestaticconstexpr |
Returns an unique identifier for the hash algorithm.
Definition at line 608 of file keccak.hpp.
|
inlinefinaloverridevirtual |
Returns the name of the checksum or the hash algorithm.
Implements libxcks::Checksum.
Definition at line 553 of file keccak.hpp.
|
inlinestatic |
Gets a new instance of this class.
The caller is responsible of the deletion of the instance with the delete
operator.
Definition at line 621 of file keccak.hpp.
|
inlinefinaloverridevirtual |
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method.
Implements libxcks::Checksum.
Definition at line 546 of file keccak.hpp.
|
finaloverridevirtual |
Returns the SHA3-512 hash value in the first 64 bytes of the given address.
buffer | The buffer where the SHA3-512 hash value will be stored. |
Implements libxcks::Checksum.
Definition at line 350 of file keccak.cpp.