Implements the SHA384 hashfunction, i.e. sha-384. Inherits from SHAx. More...
#include <sha384.hpp>
Public Member Functions | |
void | preprocess (std::vector< uint8_t > initialMessage) |
Parses a vector of bytes and applies to it the transformations specified in the NIST's specification. | |
void | round (unsigned int counter) |
Performs a round over the 16 message bytes contained in M, starting at counter and finishing at counter+"something". In the end, the internal state H is updated to the new value. | |
void | hash (std::vector< uint8_t > initialMessage) |
Performs all the steps necessary to hash the message given on the input. In the end, the internal state H contains the digest of the message. | |
std::vector< uint8_t > | getHash () |
Returns a vector of uint8_t containing the hash. | |
std::string | getType () |
To know which hashfunction it is. | |
uint32_t | getHashLength () |
To know the bitlength of the hash we should expect. |
Private Attributes | |
uint64_t | H [8] |
The internal state; 8 words of 64 bits. | |
std::vector< uint64_t > | M |
Message to be hashed. | |
uint64_t | l |
Length of the message (in bits). | |
64 bits temporary variables | |
uint64_t | a |
uint64_t | b |
uint64_t | c |
uint64_t | d |
uint64_t | e |
uint64_t | f |
uint64_t | g |
uint64_t | h |
Implements the SHA384 hashfunction, i.e. sha-384. Inherits from SHAx.
Definition at line 24 of file sha384.hpp.
|
virtual |
Returns a vector of uint8_t containing the hash.
Reimplemented from cryptoTools::SHAx.
Definition at line 152 of file sha384.cpp.
|
virtual |
To know the bitlength of the hash we should expect.
Reimplemented from cryptoTools::SHAx.
Definition at line 177 of file sha384.cpp.
|
virtual |
To know which hashfunction it is.
Reimplemented from cryptoTools::SHAx.
Definition at line 171 of file sha384.cpp.
|
virtual |
Performs all the steps necessary to hash the message given on the input. In the end, the internal state H contains the digest of the message.
Calls preprocess over its input and then uses a loop over the length of the message to call round on each of its blocks.
initialMessage | A byte vector containing the message to hash. |
Reimplemented from cryptoTools::SHAx.
Definition at line 144 of file sha384.cpp.
|
virtual |
Parses a vector of bytes and applies to it the transformations specified in the NIST's specification.
Once the call to this function is finished, the M attribute is correctly assigned i.e. it contains 32 bits words, the padding and the length of the initial input. The internal state is also initialised.
initialMessage | A byte vector containing the message to hash. |
Reimplemented from cryptoTools::SHAx.
Definition at line 77 of file sha384.cpp.
|
virtual |
Performs a round over the 16 message bytes contained in M, starting at counter and finishing at counter+"something". In the end, the internal state H is updated to the new value.
Reimplemented from cryptoTools::SHAx.
Definition at line 115 of file sha384.cpp.
|
private |
Definition at line 37 of file sha384.hpp.
|
private |
Definition at line 38 of file sha384.hpp.
|
private |
Definition at line 39 of file sha384.hpp.
|
private |
Definition at line 40 of file sha384.hpp.
|
private |
Definition at line 41 of file sha384.hpp.
|
private |
Definition at line 42 of file sha384.hpp.
|
private |
Definition at line 43 of file sha384.hpp.
|
private |
The internal state; 8 words of 64 bits.
Definition at line 30 of file sha384.hpp.
|
private |
Definition at line 44 of file sha384.hpp.
|
private |
Length of the message (in bits).
Definition at line 55 of file sha384.hpp.
|
private |
Message to be hashed.
Definition at line 50 of file sha384.hpp.