Repository navigation
Add EdDSA streaming support - #494
padelsbach wants to merge 1 commit into
Conversation
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
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
| * @return 1 on success. | ||
| * @return 0 on failure. | ||
| */ | ||
| static int wp_ecx_digest_signverify_update(wp_EcxSigCtx *ctx, |
There was a problem hiding this comment.
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.
e6831da to
800657a
Compare
There was a problem hiding this comment.
🟡 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
| static int wp_ecx_digest_signverify_update(wp_EcxSigCtx *ctx, | ||
| const unsigned char *data, size_t dataLen) |
| if (!wolfssl_prov_is_running()) { | ||
| ok = 0; | ||
| } | ||
| if (ok && (dataLen > 0)) { |
| if (ok && (!wp_ecx_up_ref(srcCtx->ecx))) { | ||
| ok = 0; | ||
| } | ||
| if (ok && (srcCtx->msgLen > 0)) { |
| if (ok && (srcCtx->msgLen > 0)) { | ||
| dstCtx->msg = OPENSSL_malloc(srcCtx->msgLen); | ||
| if (dstCtx->msg == NULL) { | ||
| ok = 0; |


No description provided.