Hmac, aka hash-based message authentication code.
More...
#include <hash.h>
|
static bool | supported (int) |
| Test if an algorithm type is supported.
|
|
Hmac, aka hash-based message authentication code.
https://tools.ietf.org/html/rfc2104
Streaming class allows updates of the hash and calculation of a final result.
- Examples
- scclib/crypto/unittest/hash_digest.cc.
Definition at line 264 of file hash.h.
◆ Hmac() [1/4]
Construct an hmac.
- Parameters
-
key | key to set into the hmac |
len | length of key |
hash_alg | hash algorithm, |
- See also
- Hash::Algorithm
◆ Hmac() [2/4]
scc::crypto::Hmac::Hmac |
( |
const std::vector< char > & |
key, |
|
|
Hash::Algorithm |
alg |
|
) |
| |
|
inline |
Construct an hmac.
- Parameters
-
key | key to set into the hmac |
hash_alg | hash algorithm, |
- See also
- Hash::Algorithm
Definition at line 279 of file hash.h.
◆ Hmac() [3/4]
Construct an hmac.
- Parameters
-
key | key to set into the hmac |
hash_alg | hash algorithm, |
- See also
- Hash::Algorithm
Definition at line 284 of file hash.h.
◆ Hmac() [4/4]
scc::crypto::Hmac::Hmac |
( |
Hmac && |
other | ) |
|
Move constructor.
Original hmac will throw an exception if operations are attempted.
◆ alg()
int scc::crypto::Hmac::alg |
( |
| ) |
const |
|
inline |
◆ final() [1/2]
int scc::crypto::Hmac::final |
( |
std::vector< char > & |
v | ) |
|
|
inline |
Calculate the final hmac value.
Return size written.
Definition at line 330 of file hash.h.
◆ final() [2/2]
int scc::crypto::Hmac::final |
( |
void * |
, |
|
|
int |
|
|
) |
| |
Calculate the final hmac value.
Reset the hmac, using the same key.
- Parameters
-
loc | Location to write final hash value |
len | Available buffer size, should be >= size required by hash. |
- Returns
- Size written
- Examples
- scclib/crypto/unittest/hash_digest.cc.
◆ init()
void scc::crypto::Hmac::init |
( |
const void * |
, |
|
|
int |
|
|
) |
| |
Initialize the hmac with a new key.
- Parameters
-
key | key to set into the hmac |
len | length of key |
◆ operator=()
Hmac& scc::crypto::Hmac::operator= |
( |
Hmac && |
other | ) |
|
Move assign.
Original hmac will throw an exception if operations are attempted.
The documentation for this class was generated from the following file: