<PackageReference Include="BouncyCastle.Cryptography" Version="2.7.0" />

Org.BouncyCastle.Crypto.Signers.MLDsaSigner

public sealed class MLDsaSigner : ISigner
ML-DSA (FIPS 204) signature primitive. Accumulates the message via the streaming ISigner surface and dispatches it through the FIPS 204 message-representative construction. The signer must be bound to the same ParameterSet as the key it is initialised with. Optional ParametersWithContext (up to 255 bytes) and ParametersWithRandom envelopes are unwrapped during Init.
public string AlgorithmName { get; }

public MLDsaSigner(MLDsaParameters parameters, bool deterministic)

Construct an ML-DSA signer for the supplied parameter set. Only the pure variants are accepted; the HashML-DSA variants (those carrying a pre-hash OID) must go through their dedicated wrapper instead.

public void BlockUpdate(byte[] input, int inOff, int inLen)

public void BlockUpdate(ReadOnlySpan<byte> input)

public byte[] GenerateSignature()

Finalise the message representative and produce the signature. Internally calls Reset on success.

public int GetMaxSignatureSize()

Length in bytes of the signatures this signer produces (FIPS 204 CryptoBytes).

public void Init(bool forSigning, ICipherParameters parameters)

Initialise for signing (private key) or verification (public key). Accepts ParametersWithContext for a context up to 255 bytes and ParametersWithRandom for a non-deterministic signer's nonce source.

public void Reset()

Reset the streaming digest and re-seed it with the bound public-key hash and the captured context, ready for another sign/verify pass against the same key.

public void Update(byte input)

public bool VerifySignature(byte[] signature)

Finalise the message representative and verify signature. Internally calls Reset on success.