public class AsconHashSpi extends AsconMessageDigestSpi
Ascon-Hash uses a sponge-based mode of operation and provides 128-bit security with a hash size of 256 bits.
The hashing mode uses the same lightweight 320-bit permutation as the authenticated encryption mode Ascon-128.
The Ascon-Hash sponge absorbs the message in 64-bit blocks and finally squeezes the hash value in 64-bit blocks. After each absorbed message block except the last, the intermediate 12-round permutation is applied to the state. The full 12-round permutation is applied in the initialization and finalization after the last message block. Finally, the 256-bit tag is returned.
When desired, it is recommended to pair the primary proposals, Ascon-128 and Ascon-Hash,
or to pair the secondary proposals, Ascon-128a and Ascon-Hasha
(both have the same number of rounds for the intermediate permutation).
For more details, we refer to the official Ascon specification.
Usage example:
// register IAIK-LW provider IaikLw.addAsProvider();
// the message to be absorbed byte[] msg = ...;
// message absorb and digest
MessageDigest md = MessageDigest.getInstance("Ascon-Hash");
md.update(msg);
byte[] hash = md.digest();
| Constructor and Description |
|---|
AsconHashSpi() |
| Modifier and Type | Method and Description |
|---|---|
String |
getVariant()
Gets the variant name.
|
engineDigest, engineGetDigestLength, engineReset, engineUpdate, engineUpdateclone, engineDigest, engineUpdatepublic String getVariant()
getVariant in class AsconMessageDigestSpiCopyright © 2022–2023 Stiftung SIC. All rights reserved.