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.
21 lines
548 B
Go
21 lines
548 B
Go
// Copyright (C) 2019-2025, Lux Industries Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package kats
|
|
|
|
import (
|
|
"encoding/hex"
|
|
)
|
|
|
|
// mustDecodeHex is the helper the generated vectors_mldsaXX.go
|
|
// files call to inline byte literals. A malformed input is a
|
|
// compile-time defect — we panic so tests fail loudly at init
|
|
// rather than producing silent zero-byte slices.
|
|
func mustDecodeHex(s string) []byte {
|
|
b, err := hex.DecodeString(s)
|
|
if err != nil {
|
|
panic("kats: bad hex literal: " + err.Error())
|
|
}
|
|
return b
|
|
}
|