Files
crypto/pq/mldsa/kats/vectors_helpers.go
T
Hanzo AI 1f07474b54 crypto/pq/mldsa: KAT vectors + expanded-key form + ethdilithium-compat
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.
2026-05-10 21:38:38 -07:00

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
}