ddn.crypto.mac.hmac

HMAC implementation (RFC 2104).

class HMAC

Types 1

classHMAC : MAC

HMAC implementation (RFC 2104).

Fields
private Hash _hash
private ubyte[] _kIpad
private ubyte[] _kOpad
Methods
void initialize(const(ubyte)[] key)Initializes (or re-initializes) the HMAC with the given secret key.
MAC update(const(ubyte)[] input)Updates the HMAC with the given input data. Params: input = The data to update with. Returns: The MAC instance itself for method chaining.
ubyte[] finish()Finalizes the HMAC computation and returns the tag. Resets the HMAC to its initial state (ready for a new message with the same key). Returns: The authentication tag.
void reset()Resets the HMAC to its initial state.
size_t size() @property constReturns: The size of the MAC tag in bytes.
Constructors
this(Hash hash, const(ubyte)[] key)Constructs a new HMAC instance. Params: hash = The hash algorithm to use. This instance will be used exclusively by HMAC. key = The secret key.