Message Authentication Codes

Index

mac/clear mac/final mac/get-keyspec mac/new mac/output-length mac/set-key mac/set-nonce mac/update

Reference

mac/clearcfunction
(mac/clear mac-obj)

Reset the state of `mac` back to clean, as if no key and input has been supplied. Returns `mac-obj`.

mac/finalcfunction
(mac/final mac-obj)

Finalize the MAC and return the output.

(mac/get-keyspec mac-obj)

Return the key spec of the `mac` in format of [max-key-length min-key-length mod-key-length].

mac/newcfunction
(mac/new name)

Creates a MAC of the given name, e.g., "HMAC(SHA-384)".Returns `mac-obj`.

(mac/output-length mac-obj)

Return the output length of the `mac`

mac/set-keycfunction
(mac/set-key mac-obj key)

Set the `key` for the MAC calculation. Returns `mac-obj`.

mac/set-noncecfunction
(mac/set-nonce mac-obj key)

Set the `nonce` for the MAC calculation. Returns `mac-obj`.Note that not all MAC algorithms require a nonce. If a nonce is required, the function has to be called before the data is processed.

mac/updatecfunction
(mac/update mac-obj input)

Add input to the MAC computation. Returns `mac-obj`.