From e40dbb45881ce2e44c8f9233ab9231ed8a61d4e9 Mon Sep 17 00:00:00 2001 From: umadayal Date: Wed, 30 Oct 2024 16:23:11 -0700 Subject: [PATCH 1/2] update docs --- book/writing-programs/patched-crates.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/book/writing-programs/patched-crates.md b/book/writing-programs/patched-crates.md index c29cbf3edd..edb7bcf6c3 100644 --- a/book/writing-programs/patched-crates.md +++ b/book/writing-programs/patched-crates.md @@ -16,7 +16,7 @@ Under the hood, we use [precompiles](./precompiles.md) to achieve tremendous per | ed25519-consensus | [sp1-patches/ed25519-consensus](http://github.com/sp1-patches/ed25519-consensus) | ed25519 verify | | curve25519-dalek-ng | [sp1-patches/curve25519-dalek-ng](https://github.com/sp1-patches/curve25519-dalek-ng) | ed25519 verify | | curve25519-dalek | [sp1-patches/curve25519-dalek](https://github.com/sp1-patches/curve25519-dalek) | ed25519 verify | -| ecdsa-core | [sp1-patches/signatures](http://github.com/sp1-patches/signatures) | secp256k1 verify | +| ecdsa-core | [sp1-patches/signatures](http://github.com/sp1-patches/signatures) | secp256k1 and secp256r1 verify | | secp256k1 | [sp1-patches/rust-secp256k1](http://github.com/sp1-patches/rust-secp256k1) | secp256k1 verify | | substrate-bn | [sp1-patches/bn](https://github.com/sp1-patches/bn) | BN254 | | substrate-bls12_381 | [sp1-patches/bls12_381](https://github.com/sp1-patches/bls12_381) | BLS12-381 | @@ -38,7 +38,7 @@ tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch = "pa curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", branch = "patch-curve25519-v4.1.3" } curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", branch = "patch-v4.1.1" } ed25519-consensus = { git = "https://github.com/sp1-patches/ed25519-consensus", branch = "patch-v2.1.0" } -ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "patch-ecdsa-v0.16.9" } +ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "umadayal/secp256r1" } secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", branch = "patch-secp256k1-v0.29.0" } substrate-bn = { git = "https://github.com/sp1-patches/bn", branch = "patch-v0.6.0" } bls12_381 = { git = "https://github.com/sp1-patches/bls12_381", branch = "patch-v0.8.0" } @@ -111,6 +111,13 @@ Apply the following patches based on what crates are in your dependencies. secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", branch = "patch-v0.29.0" } ``` +- `secp256r1` + ```toml + ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "umadayal/secp256r1" } + ``` + + Note: The curve operations for `p256` are inside of the `ecdsa-core` crate, so you don't need to patch `secp256r1` itself, and just patching `ecdsa-core` is enough. + ## BN254 Acceleration To accelerate BN254 (Also known as BN128 and Alt-BN128), you will need to patch the `substrate-bn` crate. From 8e37905afe8c41b7d013f37df0b8c196a30102b3 Mon Sep 17 00:00:00 2001 From: umadayal Date: Mon, 4 Nov 2024 16:24:28 -0800 Subject: [PATCH 2/2] p256 --- book/writing-programs/patched-crates.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/book/writing-programs/patched-crates.md b/book/writing-programs/patched-crates.md index edb7bcf6c3..00ae55ea6c 100644 --- a/book/writing-programs/patched-crates.md +++ b/book/writing-programs/patched-crates.md @@ -106,17 +106,18 @@ Apply the following patches based on what crates are in your dependencies. Note: The curve operations for `k256` are inside of the `ecdsa-core` crate, so you don't need to patch `k256` itself, and just patching `ecdsa-core` is enough. +- `p256` +```toml +ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "umadayal/secp256r1" } +``` + +Note: The curve operations for `p256` are inside of the `ecdsa-core` crate, so you don't need to patch `secp256r1` itself, and just patching `ecdsa-core` is enough. + - `secp256k1` ```toml secp256k1 = { git = "https://github.com/sp1-patches/rust-secp256k1", branch = "patch-v0.29.0" } ``` -- `secp256r1` - ```toml - ecdsa-core = { git = "https://github.com/sp1-patches/signatures", package = "ecdsa", branch = "umadayal/secp256r1" } - ``` - - Note: The curve operations for `p256` are inside of the `ecdsa-core` crate, so you don't need to patch `secp256r1` itself, and just patching `ecdsa-core` is enough. ## BN254 Acceleration To accelerate BN254 (Also known as BN128 and Alt-BN128), you will need to patch the `substrate-bn` crate.