AsconHashA256 Class
Definition
- Namespace
- Bodu.Security.Cryptography
- Assembly
- Bodu.Security.Cryptography.dll
- Package
- Bodu.Security.Cryptography 1.2.0
- Source
- AsconHashA256.cs
Computes a hash using the ASCON-HASHA256 cryptographic hash algorithm as defined in NIST SP 800-232. Produces
a 256-bit (32-byte) digest using a reduced-round Ascon-p permutation during absorption over a 320-bit sponge state.
This class cannot be inherited.
public sealed class AsconHashA256 : AsconHash, ICryptoTransform, IDisposable
- Inheritance
-
AsconHashA256
- Implements
- Inherited Members
- Extension Methods
Examples
using var hash = new AsconHashA256();
byte[] digest = hash.ComputeHash(message);
Remarks
ASCON-HASHA256 uses an 8-round Ascon-p permutation (Ascon-p8) during message block absorption and the full 12-round permutation (Ascon-p12) during the initial squeeze phase. Subsequent squeeze blocks also use Ascon-p8. The reduced absorption round count improves throughput for long messages relative to AsconHash256 at a reduced - though still substantial - security margin.
For the highest security margin, use AsconHash256, which applies Ascon-p12 at every phase.
Parameters at a glance.
- Output size: 256 bits (32 bytes), fixed.
- State: 320 bits sponge; rate: 64 bits (8 bytes).
- Permutation: Ascon-p12 for initialization and the first squeeze; Ascon-p8 for absorption and subsequent squeezes.
- Specification: NIST SP 800-232 (ASCON family).
When to choose ASCON-HASHA256. Pick this when ASCON-family interop is required and message throughput matters more than the extra round-count margin of AsconHash256 - typical for IoT gateways and lightweight protocols that hash sustained streams of telemetry. For maximum margin use AsconHash256; for non-ASCON throughput-sensitive hashing on commodity hardware Blake3 is faster still.
Constructors
AsconHashA256()
Initializes a new instance of the AsconHashA256 class.
public AsconHashA256()
Applies to
| Product | Versions |
|---|---|
| .NET | 8, 10 |