public class AsconHashASpi extends AsconMessageDigestSpi
Ascon-Hasha 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-Hasha 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 8-round permutation is applied to the state.
For Ascon-Hash, an intermediate 12-round permutation is applied.
The full 12-round permutation is applied for both Ascon-Hasha and Ascon-Hash 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-Hasha");
md.update(msg);
byte[] hash = md.digest();
| Constructor and Description |
|---|
AsconHashASpi() |
| 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.