Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use elliptic instead of @noble/curves for Node crypto #629

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

bestbeforetoday
Copy link
Member

@bestbeforetoday bestbeforetoday commented Sep 9, 2023

@noble/curves makes use of @noble/hashes, which does not function correctly on big-endian systems, and also throws an error on module load if a big-endian system is detected. Revert to using elliptic as the ECDSA signing implementation.

Closes #628

`@noble/curves` has a dependency on `@noble/hashes`, and this throws an
error on module load if it detects a big-endian platform since it does
not function correctly on big-endian systems.

This change uses dynamic module loading to avoid loading `@noble/curves`
unless one of the default ECDSA signer implementations is created. Users
of big-endian systems can create their own signer implementation,
perhaps based on Node's crypto implementation instead.

Signed-off-by: Mark S. Lewis <[email protected]>
@bestbeforetoday bestbeforetoday marked this pull request as ready for review September 9, 2023 15:09
@bestbeforetoday bestbeforetoday requested a review from a team as a code owner September 9, 2023 15:09
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) September 9, 2023 15:10
@bestbeforetoday bestbeforetoday force-pushed the s390x branch 2 times, most recently from 52a230f to b8de7aa Compare September 10, 2023 22:53
@noble/curves makes use of @noble/hashes, which does not function
correctly on big-endian systems, and also throws an error on module load
if a big-endian system is detected. Revert to using elliptic as the
ECDSA signing implementation.

Signed-off-by: Mark S. Lewis <[email protected]>
@bestbeforetoday bestbeforetoday enabled auto-merge (squash) September 10, 2023 23:16
@bestbeforetoday bestbeforetoday changed the title Avoid Node module load error on big-endian platforms Use elliptic instead of @noble/curves for Node crypto Sep 10, 2023
@bestbeforetoday bestbeforetoday merged commit f75f440 into hyperledger:main Sep 11, 2023
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.

Node.js package @hyperledger/fabric-gateway 1.3.1 breaks on s390x
2 participants