libxcks
0.1.0.1
|
Computes the SHA384 hash from a byte stream. More...
#include <sha384_512.hpp>
Public Member Functions | |
SHA384 () | |
Default constructor. More... | |
void | reset () override |
Resets the SHA384 hash to initial state of computation. More... | |
uint8_t * | getValue (uint8_t *buffer) const override |
Returns the SHA384 hash value in the first 48 bytes of the given address. More... | |
size_t | getSize () const override |
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method. More... | |
std::string | getName () const override |
Returns the name of the checksum or the hash algorithm. More... | |
ArrayString | getAltNames () const override |
Returns the alternative names of the SHA384 hash algorithm. More... | |
ChecksumAlgoId | getID () const override |
Returns an unique identifier for the checksum or the hash algorithm. More... | |
Public Member Functions inherited from libxcks::AbstractSHA512Impl | |
void | update (const uint8_t *buf, size_t len) override final |
Updates the SHA512 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 SHA384 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::AbstractSHA512Impl | |
void | finish () |
Process the remaining bytes in the internal buffer and the usual prolog according to the standard. More... | |
void | transform (uint8_t *data) |
Transform the message X which consists of 16 64-bit-words. More... | |
Static Protected Member Functions inherited from libxcks::LibgcryptHash | |
static uint32_t | rol (uint32_t x, int n) |
Rotate the 32 bit unsigned integer x by n bits left. More... | |
static uint32_t | ror (uint32_t x, int n) |
Rotate the 32 bit unsigned integer x by n bits right. 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::AbstractSHA512Impl | |
uint64_t | h0 |
First part of the state of computation. More... | |
uint64_t | h1 |
Second part of the state of computation. More... | |
uint64_t | h2 |
Third part of the state of computation. More... | |
uint64_t | h3 |
Fourth part of the state of computation. More... | |
uint64_t | h4 |
Fifth part of the state of computation. More... | |
uint64_t | h5 |
Sixth part of the state of computation. More... | |
uint64_t | h6 |
Seventh part of the state of computation. More... | |
uint64_t | h7 |
Eighth part of the state of computation. More... | |
uint64_t | nblocks |
Number of blocks. More... | |
int | count |
Current size of the input buffer. More... | |
uint8_t | ibuffer [128] |
Input buffer. More... | |
Computes the SHA384 hash from a byte stream.
This class is a rewrite in C++ of the sha384/512 hash computing algorithm present in the Libgcrypt. Please see the GNU Privacy Guard project website for more informations.
Using this class in very simple:
Use the update method to provide to the class the bytes for computing the hash.
The SHA384 hash value can be gotten by two ways:
The SHA384 hash computing can be reseted by the reset method.
Definition at line 116 of file sha384_512.hpp.
libxcks::SHA384::SHA384 | ( | ) |
Default constructor.
Definition at line 332 of file sha384_512.cpp.
|
static |
Returns the alternative names of the SHA384 hash algorithm.
Definition at line 377 of file sha384_512.cpp.
|
inlineoverridevirtual |
Returns the alternative names of the SHA384 hash algorithm.
Reimplemented from libxcks::Checksum.
Definition at line 163 of file sha384_512.hpp.
|
inlinestatic |
Returns the name of the hash algorithm.
Definition at line 187 of file sha384_512.hpp.
|
inlineoverridevirtual |
Returns an unique identifier for the checksum or the hash algorithm.
Implements libxcks::Checksum.
Definition at line 177 of file sha384_512.hpp.
|
inlinestaticconstexpr |
Returns an unique identifier for the hash algorithm.
Definition at line 208 of file sha384_512.hpp.
|
inlineoverridevirtual |
Returns the name of the checksum or the hash algorithm.
Implements libxcks::Checksum.
Definition at line 153 of file sha384_512.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 221 of file sha384_512.hpp.
|
inlineoverridevirtual |
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method.
Implements libxcks::Checksum.
Definition at line 146 of file sha384_512.hpp.
|
overridevirtual |
Returns the SHA384 hash value in the first 48 bytes of the given address.
buffer | The buffer where the SHA384 hash value will be stored. |
Implements libxcks::Checksum.
Definition at line 362 of file sha384_512.cpp.
|
overridevirtual |
Resets the SHA384 hash to initial state of computation.
Implements libxcks::AbstractSHA512Impl.
Definition at line 342 of file sha384_512.cpp.