TrinityCore
Trinity::Impl::GenericHMAC< HashCreator, DigestLength > Class Template Reference

#include <HMAC.h>

Public Types

using Digest = std::array< uint8, DIGEST_LENGTH >
 

Public Member Functions

 GenericHMAC (uint8 const *seed, size_t len)
 
template<typename Container >
 GenericHMAC (Container const &container)
 
 GenericHMAC (GenericHMAC const &right)
 
 GenericHMAC (GenericHMAC &&right) noexcept
 
 ~GenericHMAC ()
 
GenericHMACoperator= (GenericHMAC const &right)
 
GenericHMACoperator= (GenericHMAC &&right) noexcept
 
void UpdateData (uint8 const *data, size_t len)
 
void UpdateData (std::string_view str)
 
void UpdateData (std::string const &str)
 
void UpdateData (char const *str)
 
template<typename Container >
void UpdateData (Container const &c)
 
void Finalize ()
 
Digest const & GetDigest () const
 

Static Public Member Functions

template<typename Container >
static Digest GetDigestOf (Container const &seed, uint8 const *data, size_t len)
 
template<typename Container , typename... Ts>
static auto GetDigestOf (Container const &seed, Ts &&... pack) -> std::enable_if_t< std::conjunction_v< std::negation< std::is_integral< Ts > >... >, Digest >
 

Static Public Attributes

static constexpr size_t DIGEST_LENGTH = DigestLength
 

Private Attributes

EVP_MD_CTX * _ctx
 
EVP_PKEY * _key
 
Digest _digest = { }
 

Detailed Description

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
class Trinity::Impl::GenericHMAC< HashCreator, DigestLength >

Definition at line 34 of file HMAC.h.

Member Typedef Documentation

◆ Digest

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
using Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::Digest = std::array<uint8, DIGEST_LENGTH>

Definition at line 38 of file HMAC.h.

Constructor & Destructor Documentation

◆ GenericHMAC() [1/4]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GenericHMAC ( uint8 const *  seed,
size_t  len 
)
inline

Definition at line 58 of file HMAC.h.

◆ GenericHMAC() [2/4]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename Container >
Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GenericHMAC ( Container const &  container)
inline

Definition at line 64 of file HMAC.h.

◆ GenericHMAC() [3/4]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GenericHMAC ( GenericHMAC< HashCreator, DigestLength > const &  right)
inline

Definition at line 66 of file HMAC.h.

◆ GenericHMAC() [4/4]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GenericHMAC ( GenericHMAC< HashCreator, DigestLength > &&  right)
inlinenoexcept

Definition at line 71 of file HMAC.h.

◆ ~GenericHMAC()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::~GenericHMAC ( )
inline

Definition at line 76 of file HMAC.h.

+ Here is the call graph for this function:

Member Function Documentation

◆ Finalize()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::Finalize ( )
inline

Definition at line 119 of file HMAC.h.

+ Here is the caller graph for this function:

◆ GetDigest()

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Digest const & Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GetDigest ( ) const
inline

Definition at line 127 of file HMAC.h.

+ Here is the caller graph for this function:

◆ GetDigestOf() [1/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename Container , typename... Ts>
static auto Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GetDigestOf ( Container const &  seed,
Ts &&...  pack 
) -> std::enable_if_t<std::conjunction_v<std::negation<std::is_integral<Ts>>...>, Digest>
inlinestatic

Definition at line 50 of file HMAC.h.

+ Here is the call graph for this function:

◆ GetDigestOf() [2/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename Container >
static Digest Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::GetDigestOf ( Container const &  seed,
uint8 const *  data,
size_t  len 
)
inlinestatic

Definition at line 41 of file HMAC.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [1/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
GenericHMAC & Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::operator= ( GenericHMAC< HashCreator, DigestLength > &&  right)
inlinenoexcept

Definition at line 97 of file HMAC.h.

+ Here is the call graph for this function:

◆ operator=() [2/2]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
GenericHMAC & Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::operator= ( GenericHMAC< HashCreator, DigestLength > const &  right)
inline

Definition at line 84 of file HMAC.h.

◆ UpdateData() [1/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::UpdateData ( char const *  str)
inline

Definition at line 115 of file HMAC.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [2/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
template<typename Container >
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::UpdateData ( Container const &  c)
inline

Definition at line 117 of file HMAC.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [3/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::UpdateData ( std::string const &  str)
inline

Definition at line 114 of file HMAC.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [4/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::UpdateData ( std::string_view  str)
inline

Definition at line 113 of file HMAC.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateData() [5/5]

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
void Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::UpdateData ( uint8 const *  data,
size_t  len 
)
inline

Definition at line 108 of file HMAC.h.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _ctx

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
EVP_MD_CTX* Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::_ctx
private

Definition at line 129 of file HMAC.h.

◆ _digest

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
Digest Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::_digest = { }
private

Definition at line 131 of file HMAC.h.

◆ _key

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
EVP_PKEY* Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::_key
private

Definition at line 130 of file HMAC.h.

◆ DIGEST_LENGTH

template<GenericHashImpl::HashCreator HashCreator, size_t DigestLength>
constexpr size_t Trinity::Impl::GenericHMAC< HashCreator, DigestLength >::DIGEST_LENGTH = DigestLength
staticconstexpr

Definition at line 37 of file HMAC.h.


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