Skip to content

Add EdDSA streaming support - #494

Draft
padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:fix-eddsa-streaming-sign
Draft

padelsbach wants to merge 1 commit into
wolfSSL:masterfrom
padelsbach:fix-eddsa-streaming-sign

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

No description provided.

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot 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.

Fenrir Automated Review — PR #494

Scan targets checked: wolfprovider-src, wolfprovider-bugs
Coverage: 1 of 3 in-scope changed file(s) opened by the reviewer; not opened: test/test_ecx.c, test/unit.c

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Review tier: Lite

Comment thread src/wp_ecx_sig.c
* @return 1 on success.
* @return 0 on failure.
*/
static int wp_ecx_digest_signverify_update(wp_EcxSigCtx *ctx,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shared streaming update function is defined only under WP_HAVE_ED25519, which breaks Ed448-only builds · Logic errors

wp_ecx_digest_signverify_update is defined inside #ifdef WP_HAVE_ED25519 (lines 312-614), but wp_ed448_signature_functions (lines 852, 859) also uses it. A build with WP_HAVE_ED448 but without WP_HAVE_ED25519 fails with an undeclared identifier.

Suggested fix: Move wp_ecx_digest_signverify_update above the #ifdef WP_HAVE_ED25519 block so it is compiled whenever either Ed25519 or Ed448 is enabled.
Basis: C11 6.5.1p2: an identifier used as a primary expression must have been declared, and the preprocessor removes the only definition in Ed448-only builds.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 18:14
@padelsbach
padelsbach force-pushed the fix-eddsa-streaming-sign branch from e6831da to 800657a Compare October 23, 2026 18:14

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.

🟡 Changes recommended

Streaming finalization and Ed448-only builds are blocked, and buffer-length validation and allocation-failure cleanup need correction.

4 open issues
What changed in this PR

Adds streaming Ed25519 and Ed448 signing and verification to wolfProvider by buffering message updates and using the existing one-shot operations at finalization.

Changes:

  • Adds update/final callbacks and buffered-message lifecycle handling.
  • Adds tests comparing streamed and one-shot signatures and checking OpenSSL interoperability.
  • Registers the new streaming test in the unit suite.
File Description
test/​unit.h Declares the streaming test.
test/​unit.c Registers the streaming test.
test/​test_ecx.c Tests streamed signatures, verification, and interoperability.
src/​wp_ecx_sig.c Adds message buffering and streaming callbacks for both EdDSA algorithms.

Review effort: Balanced

Comment thread src/wp_ecx_sig.c
Comment on lines +393 to +394
static int wp_ecx_digest_signverify_update(wp_EcxSigCtx *ctx,
const unsigned char *data, size_t dataLen)
Comment thread src/wp_ecx_sig.c
if (!wolfssl_prov_is_running()) {
ok = 0;
}
if (ok && (dataLen > 0)) {
Comment thread src/wp_ecx_sig.c
if (ok && (!wp_ecx_up_ref(srcCtx->ecx))) {
ok = 0;
}
if (ok && (srcCtx->msgLen > 0)) {
Comment thread src/wp_ecx_sig.c
if (ok && (srcCtx->msgLen > 0)) {
dstCtx->msg = OPENSSL_malloc(srcCtx->msgLen);
if (dstCtx->msg == NULL) {
ok = 0;
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.

3 participants