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

std.crypto.ecc: add support for the secp256k1 curve #11880

Merged
merged 2 commits into from Jun 29, 2022

Conversation

jedisct1
Copy link
Contributor

@jedisct1 jedisct1 commented Jun 17, 2022

Usage of the secp256k1 elliptic curve recently grew exponentially, since this is the curve used by Bitcoin and other popular blockchains such as Ethereum.

With this, Zig has support for all the widely deployed elliptic curves today.

Note that scalar multiplication doesn't leverage the curve endomorphism yet, so expect a 20% speed increase soon. <-- [UPDATE: Done]

@jedisct1
Copy link
Contributor Author

The curve name is sometimes shortened to K256. I personally tend to avoid it in order to avoid confusion with NIST curves. But happy to change the type name to K256 if other people are more comfortable with that.

@jedisct1 jedisct1 added the standard library This issue involves writing Zig code for the standard library. label Jun 17, 2022
Usage of the secp256k1 elliptic curve recently grew exponentially,
since this is the curve used by Bitcoin and other popular blockchains
such as Ethereum.

With this, Zig has support for all the widely deployed elliptic curves
today.

Note that scalar multiplication doesn't leverage the curve endomorphism
yet, so expect a 20% speed increase soon.
This provides a slight speedup by reducing the number of point
doubling operations.
@jedisct1
Copy link
Contributor Author

GLV method for scalar multiplication has been implemented for mulPublic(), since the last relevant patent expired in 2020.

@jedisct1 jedisct1 merged commit 234ccb4 into ziglang:master Jun 29, 2022
@jedisct1 jedisct1 deleted the secp256k1 branch June 29, 2022 13:11
andrewrk pushed a commit that referenced this pull request Jul 19, 2022
std.crypto.ecc: add support for the secp256k1 curve

Usage of the secp256k1 elliptic curve recently grew exponentially,
since this is the curve used by Bitcoin and other popular blockchains
such as Ethereum.

With this, Zig has support for all the widely deployed elliptic curves
today.
wooster0 pushed a commit to wooster0/zig that referenced this pull request Jul 24, 2022
std.crypto.ecc: add support for the secp256k1 curve

Usage of the secp256k1 elliptic curve recently grew exponentially,
since this is the curve used by Bitcoin and other popular blockchains
such as Ethereum.

With this, Zig has support for all the widely deployed elliptic curves
today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library This issue involves writing Zig code for the standard library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant