DZen.MLDsa 1.0.0

Prefix Reserved
dotnet add package DZen.MLDsa --version 1.0.0
                    
NuGet\Install-Package DZen.MLDsa -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DZen.MLDsa" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DZen.MLDsa" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="DZen.MLDsa" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DZen.MLDsa --version 1.0.0
                    
#r "nuget: DZen.MLDsa, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DZen.MLDsa@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DZen.MLDsa&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=DZen.MLDsa&version=1.0.0
                    
Install as a Cake Tool

DZen.MLDsa

Pure-managed C# implementation of ML-DSA as specified in FIPS 204, with a forceable scalar baseline and optional x86 SSE2/AVX2 polynomial kernels. Supports ML-DSA-44, ML-DSA-65, ML-DSA-87, pure signing, and HashML-DSA with the standard SHA-2, SHA-3, and SHAKE prehash choices.

Security status: Automated reference-vector and interoperability tests are included, but this project has not received an independent security audit.

Install / build

The library references the managed SHA3 package, version 1.1.0, including its streaming SHAKE128/SHAKE256 APIs. No SHA3 source checkout is required:

dotnet add package DZen.MLDsa --version 1.0.0
dotnet build .\DZen.MLDsa.sln -c Release

Reproducible builds

The repository pins the .NET SDK in global.json, enables deterministic compiler output for all projects, normalizes NuGet package timestamps to the ZIP epoch (or honors a valid NuGet ZIP timestamp from SOURCE_DATE_EPOCH), and tracks NuGet dependency graphs in packages.lock.json files. CI builds enable Source Link path mapping and locked restore (CI=true); from a committed checkout, the library's portable PDBs carry GitHub source mappings. For a local CI-equivalent package build:

$env:CI = "true"
dotnet restore .\DZen.MLDsa.sln --locked-mode
dotnet pack .\src\DZen.MLDsa\DZen.MLDsa.csproj -c Release --no-restore -p:ContinuousIntegrationBuild=true -o .\artifacts

Reproducibility requires the pinned SDK, locked dependencies, identical source commit, and equivalent build properties. Update lock files deliberately when changing dependencies; do not build release packages from uncommitted source.

API

using DZen.MLDsa;

var mldsa = new MlDsa(MlDsaParameterSet.MlDsa65);
var (publicKey, privateKey) = mldsa.GenerateKeyPair();

byte[] context = "example"u8.ToArray();
byte[] signature = mldsa.Sign(privateKey, message, context);
bool valid = mldsa.Verify(publicKey, message, signature, context);

byte[] prehashSignature = mldsa.SignPreHash(
    privateKey, message, MlDsaPreHash.Sha512, context);
bool prehashValid = mldsa.VerifyPreHash(
    publicKey, message, prehashSignature, MlDsaPreHash.Sha512, context);

GenerateKeyPairFromSeed accepts the FIPS 204 32-byte key-generation seed. The API returns raw FIPS 204 key and signature byte arrays; it does not wrap them in ASN.1 or PEM. Contexts are limited to 255 bytes. Signing uses fresh randomness by default; deterministic: true is available for vector reproduction and deterministic interoperability tests. Keep private keys and seeds secret, and use the platform's secure storage and entropy facilities.

Input spans are consumed synchronously without retaining them. Pure ML-DSA no longer copies entire messages/keys into temporary arrays. Do not modify their backing storage during an operation.

Secret polynomial scratch and key-generation seed buffers are cleared in finally paths, including per-attempt signing vectors and pointwise-accumulation temporaries. This is best-effort managed-memory hygiene, not guaranteed erasure: JIT/runtime copies, prior GC locations, or process snapshots may retain data. No pinned workspace is used. Signing and private-key unpacking reject non-canonical η-encoded secret coefficients. ValidatePrivateKey additionally checks that those coefficients derive the encoded t0 and tr values; use it when accepting an externally supplied expanded private key. It returns false for invalid or inconsistent contents and throws ArgumentException for an invalid key length. The opaque K field cannot be verified from an expanded private key alone. These checks are not a constant-time guarantee.

The API is intentionally based on raw keys and explicit parameter sets to support future threshold-signature integrations. No threshold protocol or distributed key generation is implemented here.

Future threshold integration

The current public API is sufficient to verify a completed standard ML-DSA signature, but does not expose the internals needed to implement a distributed signer. A threshold construction must be selected before adding protocol-facing APIs: Efficient Threshold ML-DSA uses short secret sharing and distributed rejection sampling, Quorus uses MPC with an honest majority, and Trilithium uses two parties assisted by a correlated randomness provider. These have different setup, trust, and sampling requirements; ordinary signing of independently shared keys is not a threshold protocol.

The proposed minimal reusable surface is public message-representative computation (pure and HashML-DSA, preserving context/OID encoding), public-key derivation from an ordinary valid private key, and a separate advanced arithmetic/encoding facade over caller-owned spans. The latter would expose fixed parameter metadata, public matrix/challenge expansion, polynomial NTT and modular operations with explicit coefficient/domain bounds, rounding/decomposition/hint operations, and canonical public-key/signature encoding. Exact operations and share representations remain protocol-dependent. Secret-share generation, MPC comparisons, distributed rejection decisions, preprocessing, authentication, and abort handling belong in DZen.MLDsa.Threshold, not this library. Nonlinear operations such as rounding and norm checks cannot simply be applied independently to shares.

This is a proposed boundary, not an implemented or frozen public API. The existing private polynomial types and signing rejection loop are not exposed. External-mu signing alone would still require an ordinary complete secret key and would not provide threshold signing.

HashML-DSA prehash strength

By default, SignPreHash and VerifyPreHash require a prehash output of at least 256, 384, or 512 bits for ML-DSA-44, ML-DSA-65, and ML-DSA-87, respectively. This library policy reflects the collision-strength targets in FIPS 204 Table 1; it is not a FIPS restriction on otherwise valid HashML-DSA combinations. Set allowWeakPreHash: true on either API to process shorter choices, including combinations used by ACVP or other interoperability vectors.

Use IsPreHashAllowed(preHash) to check whether the default policy accepts a prehash before passing a caller-selected value to signing or verification. It returns false for weak or undefined enum values; VerifyPreHash throws ArgumentException for a weak value unless allowWeakPreHash is enabled.

Parameter set Choices accepted by the default output-length policy
ML-DSA-44 SHA-256, SHA-384, SHA-512, SHA-512/256, SHA3-256, SHA3-384, SHA3-512, SHAKE128 (32-byte output), SHAKE256 (64-byte output)
ML-DSA-65 SHA-384, SHA-512, SHA3-384, SHA3-512, SHAKE256 (64-byte output)
ML-DSA-87 SHA-512, SHA3-512, SHAKE256 (64-byte output)

The check is based on output length, not a claim that the listed hash functions have identical security properties. In particular, SHA-512/256 meets the ML-DSA-44 threshold only. Applications with specific compliance requirements should follow their governing profile.

Performance profiling

MlDsa accepts an optional MlDsaImplementation: Auto selects AVX2, then SSE2, then ScalarUnrolled; Scalar forces the original baseline; ScalarUnrolled selects scalar arithmetic with four-way unrolling; and Vector128/Vector256 explicitly request SSE2/AVX2. Explicit requests fail with PlatformNotSupportedException when unavailable. SSE2 is a baseline on x64, but .NET also runs on non-x64 targets where these x86 intrinsics are unavailable, so the scalar fallback remains relevant. Auto is the recommended general default: it resolves the best supported path during construction and reuses that selection for operations. It is not a guarantee of the fastest result on every CPU or workload. The optimized paths currently vectorize polynomial add, subtract, shift, reduction, and conditional-add kernels; the NTT butterflies and Montgomery pointwise multiplication remain scalar.

These are fixed-width arithmetic implementations, but that alone does not establish constant-time behavior. Tier0/Tier1 JIT timing across x64, ARM, and 32-bit targets, and SHA3 implementation intrinsics, have not been independently characterized for side channels. Do not treat the code as constant-time or as security-reviewed for those configurations.

Release JIT dispatch behavior

On the tested .NET 8.0.31 x64 Windows runtime, Release JIT disassembly showed Avx2.IsSupported and Sse2.IsSupported folded to process-specific constants while resolving Auto: with both supported, Resolve returned Vector256; with AVX2 disabled (COMPlus_EnableAVX2=0), it returned Vector128; with all hardware intrinsics disabled (COMPlus_EnableHWIntrinsic=0), it returned ScalarUnrolled. These checks happen during engine construction, not on every polynomial operation. Explicitly requesting an unavailable vector path throws PlatformNotSupportedException.

The selected enum is then stored per instance and passed into shared PolynomialKernels methods. Consequently, the JIT still sees a runtime dispatch value: disassembly of PolynomialKernels.Add retained its scalar, SSE2, and AVX2 branches for Auto and each forced mode. With tiering disabled, Release FullOpts emitted the same 371-byte Add body for Auto, Scalar, ScalarUnrolled, Vector128, and Vector256. With tiered PGO enabled, Tier1 code after 250 sign/verify iterations still contained both ymm AVX2 and xmm SSE2 instructions for Auto (501 bytes) and forced Scalar (499 bytes). The unselected branches remain in that shared method body but are not executed for the selected mode. These sizes and code-generation details are specific to the tested runtime and settings, not general performance guarantees. Trimming and NativeAOT were not tested.

The BenchmarkDotNet project measures individual polynomial kernels and key generation, deterministic signing, and verification for every supported implementation and parameter set. It also retains the inverse-NTT cached-index experiment, checks its output, and captures JIT disassembly.

dotnet run --project .\benchmarks\DZen.MLDsa.Benchmarks -c Release -- --filter "*PolynomialKernelBenchmarks*"
dotnet run --project .\benchmarks\DZen.MLDsa.Benchmarks -c Release -- --filter "*MlDsaBenchmarks*"
dotnet run --project .\benchmarks\DZen.MLDsa.Benchmarks -c Release -- --filter "*InverseNttBenchmarks*"

BenchmarkDotNet writes timing, allocation, and (for inverse NTT) disassembly reports under BenchmarkDotNet.Artifacts. Each run prints runtime, OS, architecture, and SSE2/AVX2 support; the BenchmarkDotNet report includes the processor model. Results are hardware/runtime-specific, not performance guarantees. The cached-index variant is for comparison only; the production NTT loop remains unchanged.

Initial SIMD profile (BenchmarkDotNet ShortRun, 3 measured iterations; nanoseconds per 256-coefficient kernel) on an AMD Ryzen 9 9950X3D, Windows 11, .NET 8.0.31:

Kernel Scalar Scalar unrolled SSE2 AVX2
Add 106.03 62.09 20.09 14.10
Subtract 105.87 61.99 20.74 14.04
Reduce32 111.53 88.53 25.97 16.09
Caddq 95.39 67.99 16.29 9.71

Initial end-to-end profile, before the span propagation below (BenchmarkDotNet ShortRun, 3 measured iterations; microseconds per operation) on the same machine:

Parameter set / operation Scalar Scalar unrolled SSE2 AVX2 Auto
ML-DSA-44 key generation 51.74 50.84 49.67 49.14 49.76
ML-DSA-44 signing 541.93 527.34 504.15 497.94 501.45
ML-DSA-44 verification 57.74 57.14 55.55 55.36 55.64
ML-DSA-65 key generation 88.43 86.86 85.78 84.92 83.89
ML-DSA-65 signing 136.64 134.61 131.53 131.45 131.08
ML-DSA-65 verification 92.89 91.34 89.81 89.85 88.46
ML-DSA-87 key generation 146.94 144.57 142.73 140.27 140.99
ML-DSA-87 signing 488.68 474.90 454.52 450.97 449.34
ML-DSA-87 verification 153.00 150.30 147.41 147.40 146.93

These are short-run measurements and useful as local comparisons, not stable performance guarantees. The optimized arithmetic does not change allocation counts in this profile. NTT butterflies and Montgomery pointwise multiplication remain scalar, limiting end-to-end gains; the measured AVX2 improvement over forced scalar is about 3–9% across these operations.

On the same benchmark machine, measured signing allocations changed from 259.72 to 199.45 KB for ML-DSA-44, 142.85 to 137.48 KB for ML-DSA-65, and 319.78 to 282.32 KB for ML-DSA-87. This removes retry-dependent allocation churn without changing the arithmetic; timing differences across separate runs are not treated as a confirmed speedup.

Most remaining scratch allocation comes from Poly instances, each owning a separate int[256], and the polynomial-vector/matrix object graphs. Replacing these with spans would require flattening and refactoring much of the arithmetic; the ML-DSA-87 matrix alone occupies 56 KiB. A blanket stackalloc workspace is therefore not used. A future workspace design should bound stack use or use pooled storage with explicit clearing of secret-dependent coefficients before reuse.

The byte-buffer path now propagates ReadOnlySpan<byte>/Span<byte> through signing, verification, key generation, packing, sampling, and SHAKE adapters. Private-key header fields are read as slices rather than copied. Small scratch buffers use bounded stack storage (at most 1,024 bytes per individual buffer), outside rejection loops; secret scratch is cleared in finally blocks, and SHAKE instances are disposed. Context/prehash components are absorbed separately without concatenating a temporary message. Returned keys/signatures and the polynomial workspace remain heap-allocated. This does not claim complete secret erasure from the managed polynomial workspace.

Prehash digests now use caller-owned spans and OIDs use static read-only data. SHA-224 and SHA-512/t process full input blocks directly, using bounded stack buffers for hash state, schedules, and the final one or two padding blocks instead of allocating padded copies of entire messages. Fixed-output SHA3 prehashes retain the dependency's array-only hashing interface: the adapter rents a 1 KiB input chunk, clears it before returning it to the pool, and copies the dependency's final digest into the caller's span. SHA3/SHAKE still have dependency-owned allocations; pool misses can allocate a chunk. Signing and verification reuse their per-operation SHAKE instance across hash phases, signed-message output is filled directly without a temporary signature array, and public-key derivation reuses its polynomial scratch instead of cloning/reallocating it.

A before/after allocation comparison on .NET 8.0.31 x64, forced scalar, uses the benchmark's fixed 32-byte seed, 1,024-byte message, and benchmark context. These are bytes per operation, measured over 100 operations after 32 warmups using GC.GetAllocatedBytesForCurrentThread, not timing results:

Parameter set Key generation, before / after Deterministic signing, before / after Verification, before / after
ML-DSA-44 72,376 / 55,168 204,520 / 142,016 66,488 / 45,904
ML-DSA-65 120,544 / 88,400 141,064 / 104,008 109,872 / 75,072
ML-DSA-87 195,160 / 140,000 289,376 / 205,152 182,392 / 121,840

Prehash-only allocations before / after the follow-up cleanup, on the same runtime (bytes per operation, excluding the caller's input/destination buffers):

Prehash 1 KiB message, before / after 1 MiB message, before / after
SHA-224 1,392 / 0 1,048,944 / 0
SHA-256 160 / 0 160 / 0
SHA-384 176 / 0 176 / 0
SHA-512 192 / 0 192 / 0
SHA-512/224 1,488 / 0 1,049,040 / 0
SHA-512/256 1,488 / 0 1,049,040 / 0
SHA3-224 2,176 / 1,024 2,176 / 1,024
SHA3-256 2,160 / 1,008 2,160 / 1,008
SHA3-384 2,144 / 992 2,144 / 992
SHA3-512 2,128 / 976 2,128 / 976
SHAKE128 424 / 264 424 / 264
SHAKE256 456 / 264 456 / 264

The prehash profile uses 100 operations after 32 warmups for 1 KiB, and eight operations after four warmups for 1 MiB. The focused checks include independent OpenSSL-derived truncated-SHA2 digests across padding/block boundaries and a 1 MiB input, destination bounds, zero per-call truncated-SHA2 allocation, and absence of an intermediate signed-message signature buffer.

Reproduce the allocation profile or run focused stack/sliced-input and allocation-regression checks:

dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --allocation-profile
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --prehash-allocation-profile
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --span-self-test

Validation and reference data

The executable test project includes:

Corpus Coverage
NIST ACVP, FIPS 204 1,335 input records: key generation, signature generation, verification, and the 720-case sigGen-tr1 set
PQnet ACVP 615 input records: key generation, signature generation, and verification
CIRCL ACVP 180 input records: key generation, signature generation, and verification
Wycheproof ML-DSA 1,138 input records, including malformed private-key rejection cases
RFC 9881, Appendix C All 18 included PEM examples: keys, certificates, and intentionally inconsistent private-key encodings
C2SP/CCTV accumulated tests Published 100-, 10,000-, and 60,000,000-iteration digests for each parameter set; 100 runs by default, larger counts selectable
C2SP/CCTV exhaustive field operations All 8,380,417 field elements hashed against the published arithmetic digest; selectable

These are source-record counts, not a deduplicated global-vector count. The three ACVP corpora have overlapping case IDs, but their input records are retained and run separately. The six Wycheproof sign_noseed cases (two per parameter set) with out-of-range private-key coefficients are executed and required to fail with ArgumentException.

Run the C# and vector suites against the source project with:

dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

To validate the packed 1.0.0 package through a separate public-API consumer, create a local package feed:

dotnet pack .\src\DZen.MLDsa\DZen.MLDsa.csproj -c Release -o .\artifacts
# Produces both DZen.MLDsa.1.0.0.nupkg and DZen.MLDsa.1.0.0.snupkg (portable PDB symbols).
$packageFeed = (Resolve-Path .\artifacts).Path
$packageCache = Join-Path $env:TEMP ("DZen.MLDsa-consumer-" + [guid]::NewGuid().ToString("N"))
dotnet restore .\tests\DZen.MLDsa.PackageConsumer\DZen.MLDsa.PackageConsumer.csproj `
    "-p:RestoreSources=https://api.nuget.org/v3/index.json" `
    "-p:MLDSAPackageFeed=$packageFeed" "-p:RestorePackagesPath=$packageCache"
if ($LASTEXITCODE -ne 0) { throw "Package consumer restore failed." }
dotnet build .\tests\DZen.MLDsa.PackageConsumer\DZen.MLDsa.PackageConsumer.csproj `
    -c Release --no-restore -t:Rebuild "-p:RestorePackagesPath=$packageCache"
if ($LASTEXITCODE -ne 0) { throw "Package consumer build failed." }
dotnet run --project .\tests\DZen.MLDsa.PackageConsumer -c Release --no-build `
    "-p:RestorePackagesPath=$packageCache"
if ($LASTEXITCODE -ne 0) { throw "Package consumer failed." }
Remove-Item -LiteralPath $packageCache -Recurse -Force

The clean package consumer restores DZen.MLDsa by PackageReference from the local feed and SHA3 from NuGet.org, validates generated private keys, exercises pure signing and HashML-DSA for all parameter sets, and checks that the package does not grant friend-assembly access. Its isolated package cache and explicit sources avoid accidentally selecting a stale same-version package from a machine-local NuGet source. If MLDSA_RUST_REFERENCE points to the built RustCrypto harness, it also cross-checks nine package-backed cases across all parameter sets and context lengths 0, 1, and 255. The full vector and SIMD suite uses the source project reference.

For a focused check of scalar/SIMD kernel and end-to-end equivalence, run:

dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --simd-self-test

The SIMD self-test also launches a child process with hardware intrinsics disabled. It verifies that Auto selects ScalarUnrolled, matches the explicit scalar and unrolled outputs for all parameter sets, and rejects explicit SSE2/AVX2 requests.

The standard run checks the 100-iteration CCTV digest. Run the longer accumulated vectors and the exhaustive field-operation vector separately:

dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --cctv-10000
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --cctv-10000-scalar
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --cctv-60000000
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release -- --cctv-field-ops

The 10,000-iteration vectors are suitable for CI; 60,000,000 iterations are a long development/soak test and run independently for each parameter set. The exhaustive field test covers the shared ML-DSA-65/87 gamma2 arithmetic once alongside ML-DSA-44, streaming the documented decimal encoding into SHAKE128 without storing the generated input.

The 100- and 10,000-iteration accumulated digests and the exhaustive field-operation digest have been run successfully. In an earlier Release run on the benchmark machine, each 10,000-iteration segment took 3.76 seconds (ML-DSA-44), 5.72 seconds (ML-DSA-65), and 7.67 seconds (ML-DSA-87) with Auto; forced scalar took 3.96, 6.02, and 8.13 seconds. The test runs parameter sets sequentially and prints the current set, so timings from different set labels are not directly comparable. Extrapolating those short runs, 60,000,000 iterations may take about 6.3, 9.5, and 12.8 hours per set respectively (about 28.6 hours total); actual soak-test duration varies with CPU load, power/thermal limits, and runtime conditions.

Optional Rust interoperability

cargo build --release --manifest-path .\tests\interop-rust\Cargo.toml
$env:MLDSA_RUST_REFERENCE = (Resolve-Path .\tests\interop-rust\target\release\mldsa-interop.exe).Path
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

Optional Java interoperability

Install a JDK and Maven, then build the Bouncy Castle-backed harness:

mvn -f .\tests\interop-java\pom.xml package
$env:MLDSA_JAVA_CLASSPATH = (Resolve-Path .\tests\interop-java\target\classes).Path + ';' + (Resolve-Path "$env:USERPROFILE\.m2\repository\org\bouncycastle\bcprov-jdk18on\1.80\bcprov-jdk18on-1.80.jar").Path
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

Optional Go interoperability

The harness uses Cloudflare CIRCL v1.6.5, whose ML-DSA packages identify their implementation as FIPS 204. It compares derived public keys and deterministic signatures, and verifies signatures in both directions for all parameter sets.

New-Item -ItemType Directory -Force .\tests\interop-go\target | Out-Null
go build -o .\tests\interop-go\target\mldsa-go.exe .\tests\interop-go
$env:MLDSA_GO_REFERENCE = (Resolve-Path .\tests\interop-go\target\mldsa-go.exe).Path
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

Optional C interoperability

The C harness uses OpenSSL's FIPS 204 ML-DSA EVP API (OpenSSL 3.5 or later) and imports the RFC 9881 PEM key examples. Build it from a Visual Studio Developer Command Prompt with OpenSSL development headers and libraries available:

New-Item -ItemType Directory -Force .\tests\interop-c\target | Out-Null
cl /nologo /O2 /I"$env:OPENSSL_ROOT\include" /Fo".\tests\interop-c\target\mldsa_openssl.obj" .\tests\interop-c\mldsa_openssl.c /link /LIBPATH:"$env:OPENSSL_ROOT\lib" libcrypto.lib /OUT:.\tests\interop-c\target\mldsa-openssl.exe
$env:PATH = "$env:OPENSSL_ROOT;$env:OPENSSL_ROOT\bin;$env:PATH"
$env:MLDSA_C_REFERENCE = (Resolve-Path .\tests\interop-c\target\mldsa-openssl.exe).Path
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

OpenSSL CLI interoperability

If you have the OpenSSL executable but not the C development headers/import library, the test runner can use pkeyutl directly:

$env:MLDSA_OPENSSL_REFERENCE = "openssl4.1.0\openssl.exe"
dotnet run --project .\tests\DZen.MLDsa.Tests -c Release

This verifies C# signatures with OpenSSL and OpenSSL signatures with C# for all parameter sets using empty and non-empty contexts. It also recomputes the accumulated digest with OpenSSL's SHAKE128 implementation when the configured runner mode requests that cross-check. The standalone C harness is a separate executable and is not the path exercised by this CLI mode.

The C and Go harnesses run only when their respective MLDSA_C_REFERENCE and MLDSA_GO_REFERENCE environment variables are set. RustCrypto, Bouncy Castle Java, and CIRCL Go interoperability have each passed nine cases across all three parameter sets and context lengths 0, 1, and 255 in earlier runs. The latest Release validation against the packed 1.0.0 candidate passed the listed reference/vector suite plus nine cases each for Rust, Go, OpenSSL CLI, and standalone C/OpenSSL; the OpenSSL SHAKE128 CCTV cross-check also passed. Java was not configured for that run and is not counted as passing it.

The standalone C harness was built with x64 MSVC using openssl4.1.0\include and lib\libcrypto.lib, after these development files were added to the original executable/DLL-only installation. The MSVC build above needs matching OpenSSL development headers (including openssl\evp.h, core_names.h, params.h, pem.h, err.h, and their generated/transitive headers), the x64 libcrypto.lib import library, and a compatible x64 C toolchain. At runtime the matching libcrypto DLL must be discoverable. This harness uses libcrypto only; it does not require linking libssl. Both OpenSSL runners normalize the RFC's indented PEM text in temporary files before importing it; the reference vectors themselves are unchanged. The CLI mode needs none of these development files. Use the explicit 4.1.0 executable path rather than assuming the executable on PATH supports ML-DSA.

The bounded corpus inventory is the three ACVP sources, the Wycheproof files, RFC 9881 Appendix C, and the C2SP/CCTV accumulated and exhaustive field-operation checks listed above. ACVP registration.json, validation.json, and internalProjection.json metadata are not test inputs and are not included. Pre-standard CRYSTALS-Dilithium vectors are intentionally excluded because they do not represent final FIPS 204 ML-DSA. RFC examples are limited to the 18 RFC 9881 Appendix C files.

The ML-DSA algorithm port itself is adapted from the C# PQnet implementation only. RustCrypto, Bouncy Castle, CIRCL, and OpenSSL are independent interoperability references, not source-code ports used by the library. NIST ACVP data is pinned to ACVP-Server commit c719d09; initial ACVP data came from PQnet, CIRCL vectors from tag v1.6.5, Wycheproof data from commit c0cfeee, the accumulated test specification from C2SP/CCTV commit b88c4b2, and PEM samples from RFC 9881.

Acknowledgements and licensing

Original DZen.MLDsa contributions are licensed under MIT; see LICENSE. The scalar ML-DSA implementation is adapted from the C# PQnet implementation by Peter Dennis Bartok. Its separate MIT license and copyright notice are retained in src/DZen.MLDsa/Upstream/LICENSE. Interop uses Bouncy Castle Java, RustCrypto ml-dsa, Cloudflare CIRCL, and OpenSSL. See THIRD-PARTY-NOTICES.md and the individual test manifests for license and source details.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 49 12/4/2026