AnCH Framework  0.1
Another C++ Hack Framework
Classes | Public Member Functions | Static Protected Member Functions | List of all members
anch::crypto::SHA2< O, B, W, R, I > Class Template Referenceabstract

SHA2 abstract class. More...

#include <sha2.hpp>

Inheritance diagram for anch::crypto::SHA2< O, B, W, R, I >:
Collaboration diagram for anch::crypto::SHA2< O, B, W, R, I >:

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 >
template<class CharT , class Traits , class Allocator >
const std::array< uint8_t, O > & digest (const std::basic_string< CharT, Traits, Allocator > &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)
 
template<class CharT , class Traits >
const std::array< uint8_t, O > & digest (std::basic_istream< CharT, Traits > &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)
 

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 ()
 

Detailed Description

template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
class anch::crypto::SHA2< O, B, W, R, I >

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.

Since
0.1
Author
Vincent Lachenal

Constructor & Destructor Documentation

template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
anch::crypto::SHA2< O, B, W, R, I >::SHA2 ( )
inline

SHA2 default constructor

template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
virtual anch::crypto::SHA2< O, B, W, R, I >::~SHA2 ( )
inlinevirtual

SHA2 destructor

Member Function Documentation

template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
virtual const std::array<uint8_t,O>& anch::crypto::SHA2< O, B, W, R, I >::digest ( ) const
inlineoverridevirtual

Get the SHA2 hash result

Returns
the SHA2 hash result

Implements anch::crypto::Hash< O, B >.

template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
static constexpr W anch::crypto::SHA2< O, B, W, R, I >::rotateLeft ( uint8_t  bits,
word 
)
inlinestaticprotected

Rotate n bits word from n bits to left

Parameters
bitsthe number of bits to rotate
wordthe n bits word to rotate
template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
static constexpr W anch::crypto::SHA2< O, B, W, R, I >::rotateRight ( uint8_t  bits,
word 
)
inlinestaticprotected

Rotate n bits word from n bits to right

Parameters
bitsthe number of bits to rotate
wordthe n bits word to rotate
template<std::size_t O, std::size_t B, typename W, uint32_t R, const std::array< W, 8 > & I>
static constexpr W anch::crypto::SHA2< O, B, W, R, I >::shiftRight ( uint8_t  bits,
word 
)
inlinestaticprotected

Shift n bits word from n bits to right

Parameters
bitsthe number of bits to shift
wordthe n bits word to shift

The documentation for this class was generated from the following file: