feat(duvet): RFC 8032 (EdDSA) requirement coverage + annotation-regression CI - #3477
feat(duvet): RFC 8032 (EdDSA) requirement coverage + annotation-regression CI#3477dougch wants to merge 2 commits into
Conversation
|
🔒 Security Review — View Report Please review before merging. |
Wire Duvet coverage for the Ed25519 / Ed25519ph surface in crypto/fipsmodule/curve25519/. Requirements are extracted from RFC 8032 prose, with a few descriptive (non-RFC-2119) statements hand-authored in rfc8032-requirements/. Source is annotated with //= citations and matching type=test annotations. Adds .duvet/README.md covering layout and local report generation. Reports are gitignored, not published.
Add check_annotations.py, which snapshots the source-code //= citations Duvet parses and fails when any baselined annotation is removed or broken. Adding annotations never fails; refresh the baseline with --update. The Duvet Annotation Coverage workflow runs the check on PRs touching .duvet/ or the annotated source and uploads the HTML report as an artifact.
| //= https://www.rfc-editor.org/rfc/rfc8032#section-5.1 | ||
| //# The context (if present at all) MUST be empty. | ||
| // Plain Ed25519: this entry point signs with no context (dom2 empty). | ||
| FIPS_service_indicator_lock_state(); |
There was a problem hiding this comment.
warning: call to undeclared function 'FIPS_service_indicator_lock_state'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
FIPS_service_indicator_lock_state();
^| //# encrypted version) to be verified. | ||
| // aws-lc verifies over the full (message, message_len) buffer, not an | ||
| // incremental IUF interface, so the whole message is present at verify time. | ||
| FIPS_service_indicator_lock_state(); |
There was a problem hiding this comment.
warning: call to undeclared function 'FIPS_service_indicator_lock_state'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
FIPS_service_indicator_lock_state();
^| // this wrong (e.g. double-hashing, or hashing an already-digested input) | ||
| // produces signatures no compliant verifier accepts; the RFC 8032 §7.3 | ||
| // KAT vectors (Ed25519phTest) guard the implementation against that. | ||
| FIPS_service_indicator_lock_state(); |
There was a problem hiding this comment.
warning: call to undeclared function 'FIPS_service_indicator_lock_state'; ISO C99 and later do not support implicit function declarations [clang-diagnostic-implicit-function-declaration]
^
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3477 +/- ##
=======================================
Coverage 78.02% 78.03%
=======================================
Files 700 700
Lines 125037 125037
Branches 17343 17354 +11
=======================================
+ Hits 97563 97571 +8
+ Misses 26605 26598 -7
+ Partials 869 868 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Context and motivation
Requirement-to-code traceability makes it visible which spec requirements are actually implemented and tested, and keeps that link from silently rotting. This PR is a focused demonstration on the EdDSA surface; it does not publish a report or gate on full coverage.
Description of changes
Adds a scoped Duvet setup that traces RFC 8032 (EdDSA) requirements to the Ed25519 / Ed25519ph implementation and tests in
crypto/fipsmodule/curve25519/, plus a CI check that fails when a requirement annotation is removed.Duvet links each normative spec requirement to the source that implements and tests it, via in-tree
//=citation annotations, and reports coverage.Contents
.duvet/config.toml— source patterns, the RFC 8032 spec, requirement patterns, report config..duvet/requirements/— requirements extracted from RFC 8032 prose (duvet extract)..duvet/rfc8032-requirements/— a few descriptive (non-RFC-2119) statements pinned by hand.//=citations incurve25519.cand matchingtype=testcitations ined25519_test.cc..duvet/README.md— layout, links, and how to generate reports locally..duvet/scripts/check_annotations.py+.duvet/annotations.baseline— annotation-regression guard..github/workflows/duvet.yml— runs the guard on PRs touching.duvet/or the annotated source, and uploads the HTML report as an artifact.Testing
The
Duvet Annotation Coverageworkflow installs Duvet (cargo install duvet --locked, matching the existingcheck-test-vectorsworkflow) and runs the regression guard://=citation is removed or broken.Refresh the baseline after intentional changes:
Generated reports live under
.duvet/reports/and are gitignored — nothing is published.Sample local report
Screenshot showing the RFC passage and the associated line in the code where this is implemented. Note the missing test, which doesn't mean we're not testing, but that the annotation hasn't been created.

Review considerations
duvet report --ci(which demands 100% coverage) so the check targets removals without forcing every extracted requirement to be cited.section-8.7implementation citation is not yet paired with a test; tracked in the README TODOs.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.