45#include <StormByte/expected.hxx>
46#include <StormByte/safe/binary.hxx>
107 std::span<const std::byte> message
121 std::span<const std::byte> message,
122 std::span<const std::byte> tag
Shared, wiped container for passwords and raw key material.
Definition password.hxx:108
One-shot message authentication codes.
StormByte::Expected< StormByte::Safe::Binary, Error > ExpectedTag
Expected full-length binary HMAC tag or a typed error.
Definition hmac.hxx:88
ExpectedTag Compute(Algorithm algorithm, const Secure::Password &key, std::span< const std::byte > message)
Compute a full-length HMAC over binary input.
Error
Errors returned by HMAC operations.
Definition hmac.hxx:79
@ BackendFailure
The cryptographic backend could not complete the operation.
Definition hmac.hxx:82
@ UnsupportedAlgorithm
The supplied algorithm value is not supported.
Definition hmac.hxx:80
@ InvalidTagSize
The supplied verification tag is not full length.
Definition hmac.hxx:81
StormByte::Expected< bool, Error > ExpectedVerification
Expected verification result or a typed error.
Definition hmac.hxx:93
Algorithm
Supported HMAC hash functions.
Definition hmac.hxx:70
@ SHA256
HMAC-SHA-256 (32-byte tag).
Definition hmac.hxx:71
@ SHA384
HMAC-SHA-384 (48-byte tag).
Definition hmac.hxx:72
ExpectedVerification 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.
Crypto module of the StormByte suite.
Definition aead.hxx:53
Root namespace of the StormByte suite.
std::conditional_t< Type::Reference< T >, std::expected< std::reference_wrapper< std::remove_reference_t< T > >, Safe::Shared< E > >, std::expected< T, Safe::Shared< E > > > Expected
#define STORMBYTE_CRYPTO_PUBLIC
Definition visibility.h:53