Skip to content

feat: add getCurves() to enumerate supported EC curves#913

Merged
boorad merged 2 commits intomainfrom
feat/get-curves
Feb 10, 2026
Merged

feat: add getCurves() to enumerate supported EC curves#913
boorad merged 2 commits intomainfrom
feat/get-curves

Conversation

@boorad
Copy link
Collaborator

@boorad boorad commented Feb 10, 2026

Summary

Implements crypto.getCurves() which returns a sorted array of supported EC curve names from OpenSSL, matching the Node.js API.

Changes

  • Add getSupportedCurves() native method on HybridEcKeyPair using EC_get_builtin_curves + OBJ_nid2sn
  • Update Nitro spec (ecKeyPair.nitro.ts) and regenerate nitrogen bindings
  • Export getCurves() as both a named export and on the default QuickCrypto object
  • Lazy-init the native helper object to avoid allocation at module import time
  • Add tests: validates expected curves present, sorted order, and getCurves() === crypto.getCurves()

Testing

Run the ECDH test suite in the example app — two new getCurves tests are included.

Closes #911

Add getSupportedCurves() native method using OpenSSL's EC_get_builtin_curves
and expose it as getCurves() in the public API, matching Node.js crypto.getCurves().

Includes tests verifying expected curves are present and results are sorted.
Defer HybridObject allocation until getCurves() is actually called,
avoiding an unnecessary native object creation at module import time.
@boorad boorad self-assigned this Feb 10, 2026
@github-actions
Copy link
Contributor

🤖 End-to-End Test Results - Android

Status: ✅ Passed
Platform: Android
Run: 21885996295

📸 Final Test Screenshot

Maestro Test Results - android

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@github-actions
Copy link
Contributor

🤖 End-to-End Test Results - iOS

Status: ✅ Passed
Platform: iOS
Run: 21885996326

📸 Final Test Screenshot

Maestro Test Results - ios

Screenshot automatically captured from End-to-End tests and will expire in 30 days


This comment is automatically updated on each test run.

@boorad boorad merged commit 2e091fa into main Feb 10, 2026
5 checks passed
@boorad boorad deleted the feat/get-curves branch February 10, 2026 23:37
boorad added a commit that referenced this pull request Feb 11, 2026
Add AES-OCB support to subtle.encrypt/decrypt/generateKey/importKey/
exportKey/wrapKey/unwrapKey, matching Node.js WebCrypto behavior.

- Add aesOcbCipher() with OCB-specific validation (tag lengths 64/96/128,
  IV max 15 bytes)
- Fix OCBCipher.cpp tag length minimum from 12 to 8 bytes
- Add AesOcbParams type and wire AES-OCB through all subtle API paths
- Fix stale coverage docs: wrap/unwrap from #914, getCurves from #913
- Add 11 AES-OCB tests (roundtrip, key sizes, AAD, tag lengths, tampering,
  wrap/unwrap)

Closes #382
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.

feat: implement crypto.getCurves()

1 participant