Documentation
¶
Overview ¶
Package algo is the catalogue of cryptographic algorithms the program is allowed to put in a CBOM: a total lookup table from a canonical algorithm ID to its CycloneDX representation.
CycloneDX enumerations are closed, and a single out-of-vocabulary value invalidates the whole document. So plugins never hand-write algorithm components: they ask this package for one by ID. An algorithm that is not in the catalogue cannot be emitted, and every field that has no authoritative source for an entry is left unset (and therefore omitted from the output).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Algorithm ¶
type Algorithm struct {
// ID is the canonical name; it becomes the component name, e.g. "ML-KEM-768".
ID string
// Primitive is the CycloneDX cryptographic primitive.
Primitive cdx.CryptoPrimitive
// OID is the dotted object identifier, or "" when no single authoritative
// OID identifies this algorithm (e.g. ECDSA and AES have none of their own).
OID string
// ParameterSet is the CycloneDX parameterSetIdentifier: the key or parameter
// size that distinguishes one variant of a family from another ("128" for
// AES-128-GCM). Empty for an entry that is a whole family.
ParameterSet string
// Mode is the block-cipher / AEAD mode of operation, when the entry names one.
Mode cdx.CryptoAlgorithmMode
// QuantumLevel is the NIST PQC security category (1-5) that the algorithm's
// defining standard assigns to it, or 0 when no standard asserts one. It is
// never inferred: 0 means "omit nistQuantumSecurityLevel".
QuantumLevel int
// NoPQCVerdict, when set, is the reason this algorithm is deliberately given no
// post-quantum verdict (the question is not a quantum one, or no citation supports
// one). Every other algorithm MUST match a rule in internal/pqc, and a test enforces
// both directions, so forgetting a verdict fails and choosing none is written down.
NoPQCVerdict string
// Legacy, when set, says the algorithm is retired or broken for CLASSICAL
// reasons, with the source. It is separate from the post-quantum verdict: a broken
// hash is not "quantum-vulnerable", it is unsafe against today's computers.
Legacy *Legacy
}
Algorithm is one catalogue entry.
func MustGet ¶
MustGet is Lookup for IDs that are compile-time constants in plugin tables; an unknown ID is a programming error.
func (Algorithm) Asset ¶
func (a Algorithm) Asset() collector.CryptoAsset
Asset renders the algorithm as a finding a collector can return.