FastMM documentation
FastMM C++ API 0.6.0
Public headers, tier 1 and tier 2
Loading...
Searching...
No Matches
fastmm::net::HmacSha256Key Class Reference

HMAC-SHA256 with the key schedule precomputed (see the header comment). More...

#include <fastmm/net/crypto.hpp>

Public Member Functions

 HmacSha256Key () noexcept
 
 HmacSha256Key (std::string_view key) noexcept
 
void sign (std::string_view data, std::span< std::uint8_t, kSha256Size > out) const noexcept
 
HexSha256 sign_hex (std::string_view data) const noexcept
 

Static Public Attributes

static constexpr std::size_t kCtxBytes = 128
 Opaque storage for one OpenSSL SHA256_CTX (112 bytes; checked in crypto.cpp).
 

Detailed Description

HMAC-SHA256 with the key schedule precomputed (see the header comment).

Copyable; a default-constructed key signs with the empty key.

Constructor & Destructor Documentation

◆ HmacSha256Key() [1/2]

fastmm::net::HmacSha256Key::HmacSha256Key ( )
inlinenoexcept

◆ HmacSha256Key() [2/2]

fastmm::net::HmacSha256Key::HmacSha256Key ( std::string_view  key)
explicitnoexcept

Member Function Documentation

◆ sign()

void fastmm::net::HmacSha256Key::sign ( std::string_view  data,
std::span< std::uint8_t, kSha256Size >  out 
) const
noexcept

◆ sign_hex()

HexSha256 fastmm::net::HmacSha256Key::sign_hex ( std::string_view  data) const
noexcept

Member Data Documentation

◆ kCtxBytes

constexpr std::size_t fastmm::net::HmacSha256Key::kCtxBytes = 128
staticconstexpr

Opaque storage for one OpenSSL SHA256_CTX (112 bytes; checked in crypto.cpp).