AsconXof128 Class
Definition
- Namespace
- Bodu.Security.Cryptography
- Assembly
- Bodu.Security.Cryptography.dll
- Package
- Bodu.Security.Cryptography 1.2.0
- Source
- AsconXof128.cs
Computes a variable-length output using the Ascon-XOF128 extendable output function (XOF) as defined in NIST
SP 800-232. Uses the Ascon-p12 permutation for every absorption and squeeze round over a 320-bit sponge state. This
class cannot be inherited.
public sealed class AsconXof128 : AsconXof<AsconXof128>, IDisposable
- Inheritance
-
AsconXof128
- Implements
- Inherited Members
- Extension Methods
Examples
using var xof = new AsconXof128();
xof.Absorb(message);
byte[] output = xof.GetHash(64); // Produce 64 bytes of output
Remarks
Ascon-XOF128 is the NIST SP 800-232 standardized extendable output function. It uses an 8-byte (64-bit) rate and the full 12-round Ascon-p12 permutation for every absorption, transition, and squeeze round. This provides a security strength of 128 bits against collision, preimage, and second-preimage attacks (for output lengths ≥ 32 bytes).
For a fixed-length 256-bit digest, consider AsconHash256. For output with a customization string, use AsconCxof128.
Parameters at a glance.
- Output size: variable, any positive multiple of 8 bits.
- State: 320-bit sponge; rate: 8 bytes (64 bits).
- Permutation: Ascon-p12 for every absorption, transition, and squeeze round.
- Security level: 128 bits (for outputs ≥ 32 bytes).
- Specification: NIST SP 800-232 (ASCON family).
When to choose Ascon-XOF128. Pick this when an extendable-output function is required inside an Ascon-based protocol - variable-length KDF outputs, hash-based DRBGs, or any context that needs more than the 256-bit fixed output of AsconHash256. For non-Ascon settings Shake (NIST FIPS 202) or Blake3's XOF mode is faster on commodity hardware. For domain-separated output families (KMAC-style or per-purpose XOF instances), use AsconCxof128 to bind a customization string into the initial state.
Constructors
AsconXof128()
Initializes a new instance of the AsconXof128 class.
public AsconXof128()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |