pqc

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 6 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 pqc classifies the algorithms in a CBOM as quantum-vulnerable or quantum-safe, citing the standard or OID basis for every verdict.

It is a plain function over a finished CBOM, not a plugin: it neither collects anything nor depends on which collector produced the document.

The classification is evidence-based, not heuristic. A verdict exists only where a rule (rules.go) has a rationale and citations, and matching is by OID or by exact catalogue name. An algorithm that no rule covers is reported as unclassified and left unlabelled; nothing is inferred from a name that merely looks like RSA.

A verdict is about the ALGORITHM. Whether a host actually uses it is a separate question that a package inventory cannot answer; see Finding.ProvidedBy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Annotate

func Annotate(bom *cdx.BOM, rep Report)

Annotate writes each finding onto its component as namespaced properties (status, rationale, matched-by, and one basis entry per citation), replacing any earlier annotation so the call is idempotent. Components without a finding are left exactly as they were.

Types

type Class

type Class string

Class is a post-quantum verdict about an algorithm.

const (
	// Vulnerable: broken in polynomial time by a sufficiently large quantum
	// computer running Shor's algorithm.
	Vulnerable Class = "quantum-vulnerable"
	// Safe: not materially weakened by known quantum attacks, either because it is
	// a NIST post-quantum standard or because the best known quantum attack is only
	// Grover's quadratic speed-up.
	Safe Class = "quantum-safe"
)

The verdicts. There is deliberately no "unknown" verdict here: an algorithm with no evidence-backed rule is reported as unclassified, not labelled.

func ClassOf

func ClassOf(name, oid string) (Class, bool)

ClassOf returns the cited verdict for an algorithm by OID and name, or false when no rule matches (unclassified, never a guess).

type Finding

type Finding struct {
	Ref       string // the component's bom-ref
	Name      string
	OID       string
	Class     Class
	Rationale string
	Basis     []Reference
	// MatchedBy says how the rule was found, e.g. `OID 1.2.840.113549.1.1.1`,
	// `OID under arc 1.2.840.113549.1.1` or `name "RSA"`.
	MatchedBy string
	// ProvidedBy lists the bom-refs of components that `provide` this algorithm.
	// That is capability: the package can do this, which is not the same as the
	// host doing it.
	ProvidedBy []string
}

Finding is the verdict on one algorithm component.

type Reference

type Reference struct {
	Title string `json:"title"`
	URL   string `json:"url"`
}

Reference is a citation for a verdict.

type Report

type Report struct {
	Findings []Finding // sorted by Ref
	// Unclassified lists algorithm components no rule covers, by bom-ref.
	Unclassified []string
}

Report is the outcome of classifying a CBOM.

func Analyze

func Analyze(bom *cdx.BOM) Report

Analyze classifies every algorithm component in bom. It does not modify bom.

func (Report) Count

func (r Report) Count(c Class) int

Count returns how many findings have the given class.

func (Report) Summary

func (r Report) Summary() string

Summary renders a short human-readable digest of the report for the operator.

Jump to

Keyboard shortcuts

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