Crypto: provide a built-in Ed25519 backend (currently OpenSSL-only) #52

Closed
opened 2026-12-03 14:21:25 +00:00 by faumaray · 1 comment
Owner

Context

Void::Crypto exposes Ed25519 (Ed25519PrivateKey, sign_ed25519, verify_ed25519), but the implementation is gated on the OpenSSL backend (VOID_CRYPTO_HAS_OPENSSL). In minimal Nix/dev shells without OpenSSL, has_openssl_backend() is false and every Ed25519 operation fails.

Impact

VoidBuildSystem's Track D3 signed provenance (vbs publish package signatures, vbs build --locked verification) cannot be exercised or tested in those environments even though the API exists upstream.

Request

Provide a portable built-in Ed25519 implementation (or an explicitly documented optional provider selection) so signing/verification work without OpenSSL, matching how SHA-256/HMAC already work on the pure-C++ backend.

Acceptance

  • has_openssl_backend() == false still allows Ed25519 key generation, signing and verification.
  • RFC 8032 test vectors pass on the built-in backend.
  • No new mandatory external dependency.
## Context `Void::Crypto` exposes Ed25519 (`Ed25519PrivateKey`, `sign_ed25519`, `verify_ed25519`), but the implementation is gated on the OpenSSL backend (`VOID_CRYPTO_HAS_OPENSSL`). In minimal Nix/dev shells without OpenSSL, `has_openssl_backend()` is false and every Ed25519 operation fails. ## Impact VoidBuildSystem's Track D3 signed provenance (`vbs publish` package signatures, `vbs build --locked` verification) cannot be exercised or tested in those environments even though the API exists upstream. ## Request Provide a portable built-in Ed25519 implementation (or an explicitly documented optional provider selection) so signing/verification work without OpenSSL, matching how SHA-256/HMAC already work on the pure-C++ backend. ## Acceptance - `has_openssl_backend() == false` still allows Ed25519 key generation, signing and verification. - RFC 8032 test vectors pass on the built-in backend. - No new mandatory external dependency.
Author
Owner

Implemented on main (merge of branch issue-52-ed25519-manual, commit 86cb94c): a portable built-in Ed25519 backend in src/Crypto/BuiltinEd25519.hpp using the module's existing SHA-512, wired into Ed25519PrivateKey/sign_ed25519/verify_ed25519 when OpenSSL is absent (constant-time field arithmetic, canonical-S rejection, wiped scalars). RFC 8032 TEST 1/2/3 vectors, tampered signatures, key generation and malformed-size cases run on both backends. Verified: Testing;Crypto with OpenSSL and with -DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON both pass (401 tests, 398 passed, 3 skipped), and the no-OpenSSL path is ASan/UBSan clean. No new mandatory dependency. Closing as done.

Implemented on `main` (merge of branch `issue-52-ed25519-manual`, commit `86cb94c`): a portable built-in Ed25519 backend in `src/Crypto/BuiltinEd25519.hpp` using the module's existing SHA-512, wired into `Ed25519PrivateKey`/`sign_ed25519`/`verify_ed25519` when OpenSSL is absent (constant-time field arithmetic, canonical-S rejection, wiped scalars). RFC 8032 TEST 1/2/3 vectors, tampered signatures, key generation and malformed-size cases run on both backends. Verified: `Testing;Crypto` with OpenSSL and with `-DCMAKE_DISABLE_FIND_PACKAGE_OpenSSL=ON` both pass (401 tests, 398 passed, 3 skipped), and the no-OpenSSL path is ASan/UBSan clean. No new mandatory dependency. Closing as done.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Void/Library#52