Skip to content

COSE HPKE Support - #70

Draft
aidangarske wants to merge 11 commits into
wolfSSL:mainfrom
aidangarske:cose-hpke
Draft

COSE HPKE Support#70
aidangarske wants to merge 11 commits into
wolfSSL:mainfrom
aidangarske:cose-hpke

Conversation

@aidangarske

@aidangarske aidangarske commented Sep 2, 2026

Copy link
Copy Markdown
Member
  • Adds default off COSE HPKE P0 support for Encrypt0 and multi recipient Encrypt
  • Requires WOLFCOSE_EXPERIMENTAL plus each selected HPKE operation macro
  • Keeps WOLFCOSE_EXPERIMENTAL alone free of feature code
  • Adds paired CLI commands self tests and an HPKE P0 example
  • Covers all six HPKE enable selectors with negative acknowledgement tests
  • Updates HPKE CI to use the experimental acknowledgement
  • Adds experimental feature status scope and graduation documentation
  • Validation passed make experimental-check and HPKE example runs
  • Full HPKE CLI validation passed 44 tests with 0 failures

#4

@aidangarske aidangarske self-assigned this Sep 2, 2026
Copilot AI lite review requested due to automatic review settings September 2, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It introduces new cryptographic message parsing and key-management paths for attacker-controlled inputs, warranting final human security review despite strong gating and test additions.

Pull request overview

Adds experimental (opt-in) COSE-HPKE P0 support to wolfCOSE, including integrated Encrypt0 HPKE-0 and multi-recipient Encrypt HPKE-0-KE, with build-time acknowledgement gating and supporting tool/test/docs/CI coverage.

Changes:

  • Introduces HPKE-0 integrated Encrypt0 encrypt/decrypt APIs and HPKE-0-KE recipient key-encryption support inside wc_CoseEncrypt_{Encrypt,Decrypt}.
  • Extends wolfcose_tool with HPKE keygen/export and HPKE encrypt/decrypt commands, plus CLI self-tests and negative-path hardening for key output paths (POSIX).
  • Adds an HPKE example program, dedicated experimental HPKE CI workflow, and documentation for build/validation and experimental feature status.
File summaries
File Description
tools/wolfcose_tool.c Adds HPKE CLI commands, HPKE keygen with guarded output handling, and HPKE round-trip self-tests.
src/wolfcose.c Implements HPKE P0 primitives, HPKE header parsing support, and HPKE-0/HPKE-0-KE encryption/decryption logic.
scripts/cmdline-test.sh Adds opt-in HPKE CLI coverage and negative-path tests gated by EXPECT_HPKE.
Makefile Adds hpke demo target, HPKE-aware experimental gates, and strict C99 HPKE compilation lane.
include/wolfcose/wolfcose.h Publishes draft HPKE constants and integrated Encrypt0 HPKE API declarations.
include/wolfcose/settings.h Adds experimental acknowledgement + fine-grained HPKE enable/disable macros and backend requirements.
examples/hpke_demo.c New example demonstrating HPKE-0 Encrypt0 and HPKE-0-KE multi-recipient Encrypt flows.
docs/Testing.md Documents opt-in HPKE test/build workflow and coverage expectations.
docs/Macros.md Documents COSE-HPKE experimental gates and links to experimental status page.
docs/Home.md Adds navigation entry for Experimental features.
docs/Getting-Started.md Adds HPKE backend prerequisites and quickstart usage for HPKE demo/tool.
docs/Experimental.md New page tracking experimental feature status, draft versioning, and graduation plan.
docs/_Sidebar.md Adds Experimental page to docs sidebar.
.github/workflows/cose-hpke.yml New CI workflow validating HPKE unit tests, example, strict C99 lane, and CLI commands.
Review details
  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/wolfcose_tool.c
@aidangarske
aidangarske removed the request for review from wolfSSL-Fenrir-bot September 3, 2026 16:34
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