Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::Cryptography::Hmac Struct Reference

Public Types

using InternalOpaque = OpaqueObject<InternalDefinition>
 

Public Member Functions

 Hmac ()
 Construct a session using the default native backend.
 
 Hmac (Backend backend)
 Construct a session using an explicitly selected backend.
 
 Hmac (const Hmac &)=delete
 
 Hmac (Hmac &&)=delete
 
Hmacoperator= (const Hmac &)=delete
 
Hmacoperator= (Hmac &&)=delete
 
Result setType (HashType type)
 Select which hash family to use for HMAC.
 
Result setKey (Span< const uint8_t > key)
 Set the HMAC key and reset the current running MAC state.
 
Result add (Span< const uint8_t > data)
 Add more message bytes to the running HMAC computation.
 
Result getMac (MacResult &result)
 Finalize the current HMAC computation.
 
void reset ()
 Discard the current HMAC computation and clear library-owned session state.
 

Constructor & Destructor Documentation

◆ Hmac() [1/2]

SC::Cryptography::Hmac::Hmac ( )

Construct a session using the default native backend.

◆ Hmac() [2/2]

SC::Cryptography::Hmac::Hmac ( Backend backend)
explicit

Construct a session using an explicitly selected backend.

Member Function Documentation

◆ add()

Result SC::Cryptography::Hmac::add ( Span< const uint8_t > data)

Add more message bytes to the running HMAC computation.

◆ getMac()

Result SC::Cryptography::Hmac::getMac ( MacResult & result)

Finalize the current HMAC computation.

Note
Finalization consumes the session. Call setKey again before computing another MAC. result is valid only on success.

◆ reset()

void SC::Cryptography::Hmac::reset ( )

Discard the current HMAC computation and clear library-owned session state.

Note
This operation is idempotent. The selected hash type is preserved.

◆ setKey()

Result SC::Cryptography::Hmac::setKey ( Span< const uint8_t > key)

Set the HMAC key and reset the current running MAC state.

Note
Failure leaves no active key or computation.

◆ setType()

Result SC::Cryptography::Hmac::setType ( HashType type)

Select which hash family to use for HMAC.

Note
Every call resets any configured key or input state, including when the requested type is invalid. A failed call preserves the previously selected hash type but requires setKey before reuse.

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