mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
Adds NIST CAVS-style KAT regression for ML-DSA-44/65/87 and an
expanded-public-key form per EIP-8051 (~22,080-byte precomputed
A matrix for ML-DSA-65) for verifier-throughput experiments.
ethdilithium_compat subpackage re-implements the Keccak-substituted
verifier described in ZKNoxHQ/ETHDILITHIUM. NOT FIPS 204; for benchmark
and Ethereum-fallback only. Re-implemented from spec - no LGPL code
vendored.
The strict-PQ path remains crypto/pq/mldsa/mldsa{44,65,87}.{Sign,Verify}.
Patch-bump.
28 lines
988 B
Go
28 lines
988 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package kats
|
|
|
|
// Vector is one Known-Answer-Test record. Every field is the
|
|
// canonical FIPS 204 wire encoding of the value (Seed = 32-byte ξ;
|
|
// PublicKey, PrivateKey, Signature = mldsaXX wire bytes; Msg, Ctx
|
|
// = arbitrary byte slices).
|
|
type Vector struct {
|
|
// Count is the vector index within its parameter-set slice;
|
|
// surfaced in test failure messages so a diff is easy to pin.
|
|
Count int
|
|
// Seed is the 32-byte ξ fed to NewKeyFromSeed.
|
|
Seed []byte
|
|
// Msg is the message bytes passed to Sign / Verify.
|
|
Msg []byte
|
|
// Ctx is the domain-separation context. May be empty.
|
|
Ctx []byte
|
|
// PublicKey is the expected mldsaXX.PublicKey.Bytes() output.
|
|
PublicKey []byte
|
|
// PrivateKey is the expected mldsaXX.PrivateKey.Bytes() output.
|
|
PrivateKey []byte
|
|
// Signature is the expected deterministic
|
|
// mldsaXX.Sign(sk, Msg, Ctx, false) output.
|
|
Signature []byte
|
|
}
|