#include <sha2.hpp>
Classes | |
union | Chunk |
struct | Context |
Public Member Functions | |
SHA2 () | |
virtual | ~SHA2 () |
virtual const std::array< uint8_t, O > & | digest () const override |
Public Member Functions inherited from anch::crypto::Hash< O, B > | |
const std::array< uint8_t, O > & | digest (const std::string &data) |
template<std::size_t N> | |
const std::array< uint8_t, O > & | digest (const std::array< uint8_t, N > &data) |
const std::array< uint8_t, O > & | digest (const uint8_t *data, std::size_t len) |
const std::array< uint8_t, O > & | digest (std::istream &stream) |
Static Protected Member Functions | |
static constexpr W | shiftRight (uint8_t bits, W word) |
static constexpr W | rotateLeft (uint8_t bits, W word) |
static constexpr W | rotateRight (uint8_t bits, W word) |
Protected Attributes | |
Context< I > | _context |
Protected Attributes inherited from anch::crypto::Hash< O, B > | |
std::array< uint8_t, O > * | _digest |
Additional Inherited Members | |
Static Public Member Functions inherited from anch::crypto::Hash< O, B > | |
static constexpr std::size_t | getOutputSize () |
static constexpr std::size_t | getBlockSize () |
SHA2 abstract class.
SHA2 contains algorithms for SHA224/256/384/512.
The children have to define the translation array and the sigma transformation functions.
The template parameters are:
SHA224/256/384/512 are implemented in this library.
anch::crypto::SHA2< O, B, W, R, I >::SHA2 | ( | ) |
SHA2 default constructor
|
virtual |
SHA2 destructor
|
overridevirtual |
|
inlinestaticconstexprprotected |
Rotate n bits word from n bits to left
bits | the number of bits to rotate |
word | the n bits word to rotate |
|
inlinestaticconstexprprotected |
Rotate n bits word from n bits to right
bits | the number of bits to rotate |
word | the n bits word to rotate |
|
inlinestaticconstexprprotected |
Shift n bits word from n bits to right
bits | the number of bits to shift |
word | the n bits word to shift |
|
protected |
SHA2 context