Skip to content

feat: noble curve replace elliptic#56

Merged
chaitanyapotti merged 19 commits intomasterfrom
feat/noble-curve-replacement
Feb 3, 2026
Merged

feat: noble curve replace elliptic#56
chaitanyapotti merged 19 commits intomasterfrom
feat/noble-curve-replacement

Conversation

@hieu-w
Copy link
Contributor

@hieu-w hieu-w commented Jan 28, 2026

Motivation and Context

Jira Link:

Description

  • Replace elliptic by @noble/curves ver 2
  • Remove Buffer

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Note

High Risk
This rewrites core cryptographic primitives (ECDSA/ECDH/ECIES) and changes key/ciphertext types from Buffer to Uint8Array, which can affect interoperability and security-sensitive behavior (e.g., key validation, signature formatting, padding/MAC handling). Extensive tests were added, but any subtle mismatch could break consumers.

Overview
Replaces the underlying crypto implementation by swapping elliptic for @noble/curves across sign/verify, derive/derivePadded, and ECIES encrypt/decrypt, including new public/private key validation via noble utilities.

Switches all binary inputs/outputs from Buffer to Uint8Array (including the Ecies shape), updates hash/HMAC/AES plumbing to avoid Buffer helpers, and adjusts ECDH output behavior to preserve legacy “unpadded” semantics while keeping derivePadded() fixed at 32 bytes.

Updates dependencies and tests: removes elliptic from runtime deps, adds @noble/curves, introduces a dev-only eccrypto-old alias plus a comprehensive backward_compatibility.spec.ts, and tweaks browser test config to skip those node-only compatibility tests (removing the prior Buffer setup).

Written by Cursor Bugbot for commit 9948d40. This will update automatically on new commits. Configure here.

@hieu-w hieu-w force-pushed the feat/noble-curve-replacement branch from 8feec72 to be75748 Compare January 28, 2026 15:24
@hieu-w hieu-w self-assigned this Jan 28, 2026
@hieu-w hieu-w force-pushed the feat/noble-curve-replacement branch from 1ac76a6 to c6f6dce Compare January 29, 2026 04:44
This reverts commit 55af097.
Copy link

@ieow ieow left a comment

Choose a reason for hiding this comment

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

lgtm

@ieow ieow mentioned this pull request Feb 2, 2026
9 tasks
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@chaitanyapotti chaitanyapotti merged commit 3ef5131 into master Feb 3, 2026
5 checks passed
@chaitanyapotti chaitanyapotti deleted the feat/noble-curve-replacement branch February 3, 2026 11:21
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