33 template <GenericHashImpl::HashCreator HashCreator,
size_t DigestLength>
38 using Digest = std::array<uint8, DIGEST_LENGTH>;
40 template <
typename Container>
49 template <
typename Container,
typename... Ts>
50 static auto GetDigestOf(Container
const& seed, Ts&&... pack) -> std::enable_if_t<std::conjunction_v<std::negation<std::is_integral<Ts>>...>,
Digest>
53 (hash.
UpdateData(std::forward<Ts>(pack)), ...);
60 int result = EVP_DigestSignInit(
_ctx,
nullptr, HashCreator(),
nullptr,
_key);
63 template <
typename Container>
73 *
this = std::move(right);
89 int result = EVP_MD_CTX_copy_ex(
_ctx, right.
_ctx);
92 EVP_PKEY_up_ref(
_key);
103 _key = std::exchange(right._key, EVP_PKEY_new());
110 int result = EVP_DigestSignUpdate(
_ctx, data, len);
116 template <
typename Container>
122 int result = EVP_DigestSignFinal(
_ctx,
_digest.data(), &length);
void UpdateData(std::string const &str)
void UpdateData(uint8 const *data, size_t len)
GenericHMAC(GenericHMAC &&right) noexcept
static auto GetDigestOf(Container const &seed, Ts &&... pack) -> std::enable_if_t< std::conjunction_v< std::negation< std::is_integral< Ts > >... >, Digest >
void UpdateData(Container const &c)
static Digest GetDigestOf(Container const &seed, uint8 const *data, size_t len)
static constexpr size_t DIGEST_LENGTH
void UpdateData(std::string_view str)
std::array< uint8, DIGEST_LENGTH > Digest
Digest const & GetDigest() const
void UpdateData(char const *str)
GenericHMAC & operator=(GenericHMAC const &right)
GenericHMAC(uint8 const *seed, size_t len)
GenericHMAC & operator=(GenericHMAC &&right) noexcept
GenericHMAC(GenericHMAC const &right)
GenericHMAC(Container const &container)
constexpr std::size_t size()
static void DestroyCTX(EVP_MD_CTX *ctx)
static EVP_MD_CTX * MakeCTX() noexcept