digestpp 1.0
C++11 header-only message digest library
Loading...
Searching...
No Matches
ASCON

ASCON Algorithms More...

Typedefs

typedef hasher< detail::ascon_provider< detail::ascon_type::hash > > digestpp::ascon_hash
 ASCON-HASH (Ascon-Hash) hash function.
 
typedef hasher< detail::ascon_provider< detail::ascon_type::xof > > digestpp::ascon_xof
 ASCON-XOF128 extendable output function.
 
typedef hasher< detail::ascon_provider< detail::ascon_type::cxof >, mixin::ascon_cxof_mixindigestpp::ascon_cxof
 ASCON-CXOF128 customizable extendable output function.
 

Detailed Description

ASCON Algorithms

Typedef Documentation

◆ ascon_cxof

ASCON-CXOF128 customizable extendable output function.

A variant of ASCON-XOF128 that accepts a customization string. This allows for domain separation: different customization strings produce completely unrelated output streams for the same input message.

Part of the NIST Lightweight Cryptography standard.

When used without customization, output differs from Ascon-XOF128.

Standardized in NIST SP 800-232 (August 2025). Provides 128-bit security level.

Type:
Extendable output function (XOF).

Optional parameters:

Optional parameters:
customization

See mixin::ascon_cxof_mixin for the description of optional parameters.

Example:
// Absorb a string and squeeze 32 bytes of output
hasher.set_customization("My Custom ASCON");
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Main class template implementing the public API for hashing.
Definition hasher.hpp:38
hasher & absorb(const T *data, size_t len)
Absorbs bytes from a C-style pointer to character buffer.
Definition hasher.hpp:86
std::string hexsqueeze(size_t len)
Squeeze bytes and return them as a hex string.
Definition hasher.hpp:296
Example output:
73910abcd1ffbbd7685947734b964c516bff020c372d6a7b684ce23c69960598
See also
hasher, mixin::ascon_cxof_mixin, ascon_xof

◆ ascon_hash

ASCON-HASH (Ascon-Hash) hash function.

Winner of the NIST Lightweight Cryptography (LWC) competition (2023). Designed by Christoph Dobraunig, Maria Eichlseder, Florian Mendel, and Martin Schläffer.

Ascon-Hash uses a sponge construction with a 320-bit permutation and is designed to provide excellent performance on both software and hardware platforms with minimal resource requirements.

Standardized in NIST SP 800-232 (August 2025).

See also
https://csrc.nist.gov/pubs/sp/800/232/ipd
Type:
Cryptographic hash function.
Output size:
256 bits
Example:
// Output a 256-bit Ascon-Hash digest of a string
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexdigest() << '\n';
std::string hexdigest() const
Return hex digest of absorbed data.
Definition hasher.hpp:372
Example output:
23414503bf4bde7ad0e85aec94c22ae2d7cd807996b537f9564fc2974053f139
See also
hasher, ascon_xof

◆ ascon_xof

ASCON-XOF128 extendable output function.

Extendable output function from the Ascon family. Part of the NIST Lightweight Cryptography standard.

Ascon-XOF provides 128-bit security and can generate arbitrary-length output, making it suitable for key derivation, random number generation, and other applications in resource-constrained environments.

Standardized in NIST SP 800-232 (August 2025).

Type:
Extendable output function (XOF).
Example:
// Absorb a string and squeeze 32 bytes of output
hasher.absorb("The quick brown fox jumps over the lazy dog");
std::cout << hasher.hexsqueeze(32) << '\n';
Example output:
f3df449acea2811a43db747c1caa208f3402a17e5ceb43315455d7deff1ffc90
See also
hasher, ascon_hash, ascon_cxof