StormByte-Crypto 3.1.0
C++26 cryptography module of the StormByte suite
Loading...
Searching...
No Matches
hmac.hxx File Reference
#include <StormByte/crypto/secure/password.hxx>
#include <StormByte/crypto/visibility.h>
#include <StormByte/expected.hxx>
#include <StormByte/safe/binary.hxx>
#include <cstddef>
#include <span>
Include dependency graph for hmac.hxx:

Go to the source code of this file.

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
namespace  StormByte::Crypto
 Crypto module of the StormByte suite.
namespace  StormByte::Crypto::HMAC
 One-shot message authentication codes.

Typedefs

using StormByte::Crypto::HMAC::ExpectedTag = StormByte::Expected<StormByte::Safe::Binary, Error>
 Expected full-length binary HMAC tag or a typed error.
using StormByte::Crypto::HMAC::ExpectedVerification = StormByte::Expected<bool, Error>
 Expected verification result or a typed error.

Enumerations

enum class  StormByte::Crypto::HMAC::Algorithm { StormByte::Crypto::HMAC::SHA256 , StormByte::Crypto::HMAC::SHA384 }
 Supported HMAC hash functions. More...
enum class  StormByte::Crypto::HMAC::Error { StormByte::Crypto::HMAC::UnsupportedAlgorithm , StormByte::Crypto::HMAC::InvalidTagSize , StormByte::Crypto::HMAC::BackendFailure }
 Errors returned by HMAC operations. More...

Functions

ExpectedTag StormByte::Crypto::HMAC::Compute (Algorithm algorithm, const Secure::Password &key, std::span< const std::byte > message)
 Compute a full-length HMAC over binary input.
ExpectedVerification StormByte::Crypto::HMAC::Verify (Algorithm algorithm, const Secure::Password &key, std::span< const std::byte > message, std::span< const std::byte > tag)
 Verify a full-length binary HMAC in constant time with respect to tag bytes.