Skip to content

feat(duvet): RFC 8032 (EdDSA) requirement coverage + annotation-regression CI - #3477

Open
dougch wants to merge 2 commits into
aws:mainfrom
dougch:duvet-demo
Open

feat(duvet): RFC 8032 (EdDSA) requirement coverage + annotation-regression CI#3477
dougch wants to merge 2 commits into
aws:mainfrom
dougch:duvet-demo

Conversation

@dougch

@dougch dougch commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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 in curve25519.c and matching type=test citations in ed25519_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 Coverage workflow installs Duvet (cargo install duvet --locked, matching the existing check-test-vectors workflow) and runs the regression guard:

  • Fails when any baselined //= citation is removed or broken.
  • Ignores newly added annotations (prints a reminder to refresh the baseline).

Refresh the baseline after intentional changes:

python3 .duvet/scripts/check_annotations.py --update

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.
Screenshot 2026-09-02 at 10 40 10

Review considerations

  • Uses a committed baseline diff rather than duvet report --ci (which demands 100% coverage) so the check targets removals without forcing every extracted requirement to be cited.
  • The section-8.7 implementation 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.

@dougch
dougch requested a review from a team as a code owner September 2, 2026 17:38
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🔒 Security ReviewView 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

//= 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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.03%. Comparing base (fac7cb9) to head (b95ec0b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants