algo

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	// Curve is the SECG name of the elliptic curve an entry is defined on (RFC 5480
	// section 2.1.1.1), for an entry that is one curve of a family: ECDH-P256 is ECDH on
	// secp256r1. Empty otherwise.
	Curve string

	// 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 All

func All() []Algorithm

All returns every catalogue entry, sorted by ID.

func Lookup

func Lookup(id string) (Algorithm, bool)

Lookup returns the catalogue entry for id.

func MustGet

func MustGet(id string) Algorithm

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.

func (Algorithm) BOMRef

func (a Algorithm) BOMRef() string

BOMRef returns the stable bom-ref of the algorithm component. It follows the CycloneDX CBOM convention crypto/algorithm/<name>[@<oid>].

func (Algorithm) Component

func (a Algorithm) Component() cdx.Component

Component renders the algorithm as a CycloneDX cryptographic-asset component.

type Legacy

type Legacy struct {
	Summary  string
	Citation string // title of the source
	URL      string
}

Legacy is a cited statement that an algorithm is retired or broken, with the citation. Only what the cited source itself says may be put in Summary.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL