License | BSD-style |
---|---|
Maintainer | Olivier Chéron <olivier.cheron@gmail.com> |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Provide the KMAC (Keccak Message Authentication Code) algorithm, derived from the SHA-3 base algorithm Keccak and defined in NIST SP800-185.
Synopsis
- class HashAlgorithm a => HashSHAKE a
- kmac :: ( HashSHAKE a, ByteArrayAccess string, ByteArrayAccess key, ByteArrayAccess ba) => string -> key -> ba -> KMAC a
-
newtype
KMAC
a =
KMAC
{
- kmacGetDigest :: Digest a
- data Context a
- initialize :: forall a string key. ( HashSHAKE a, ByteArrayAccess string, ByteArrayAccess key) => string -> key -> Context a
- update :: ( HashSHAKE a, ByteArrayAccess ba) => Context a -> ba -> Context a
- updates :: ( HashSHAKE a, ByteArrayAccess ba) => Context a -> [ba] -> Context a
- finalize :: forall a. HashSHAKE a => Context a -> KMAC a
Documentation
class HashAlgorithm a => HashSHAKE a Source #
Type class of SHAKE algorithms.
cshakeInternalFinalize, cshakeOutputLength
kmac :: ( HashSHAKE a, ByteArrayAccess string, ByteArrayAccess key, ByteArrayAccess ba) => string -> key -> ba -> KMAC a Source #
Compute a KMAC using the supplied customization string and key.
Represent a KMAC that is a phantom type with the hash used to produce the mac.
The Eq instance is constant time. No Show instance is provided, to avoid printing by mistake.
KMAC | |
|
Incremental
initialize :: forall a string key. ( HashSHAKE a, ByteArrayAccess string, ByteArrayAccess key) => string -> key -> Context a Source #
Initialize a new incremental KMAC context with the supplied customization string and key.
update :: ( HashSHAKE a, ByteArrayAccess ba) => Context a -> ba -> Context a Source #
Incrementally update a KMAC context.