From ab2856f96b929a7b98548933655c112277d7123f Mon Sep 17 00:00:00 2001 From: umadayal Date: Fri, 11 Oct 2024 16:31:14 -0700 Subject: [PATCH 1/2] now points to my branch of ecdsa-core which accelerates verify_prehash --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fbf479214..cbe785064 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ wasm-bindgen-test = "0.3" getrandom = { version = "0.2", features = ["js"] } [target.'cfg(all(target_os = "zkvm", target_vendor = "succinct"))'.dependencies] -sp1-ecdsa = { git = "https://github.com/sp1-patches/signatures", branch = "patch-ecdsa-v0.16.9", package = "ecdsa", features = ["verifying", "alloc"] } +sp1-ecdsa = { git = "https://github.com/sp1-patches/signatures", branch = "umadayal/secp256r1", package = "ecdsa", features = ["verifying", "alloc"] } k256 = { version = "0.13.3", features = ["ecdsa"] } elliptic-curve = { version = "0.13.6", default-features = false, features = ["digest", "sec1"] } From ec5a715b5fb7723f7bea3c79c9202cd6f20970d0 Mon Sep 17 00:00:00 2001 From: umadayal Date: Wed, 16 Oct 2024 15:49:53 -0700 Subject: [PATCH 2/2] recover_from_prehash --- src/ecdsa/recovery.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ecdsa/recovery.rs b/src/ecdsa/recovery.rs index 7632e8545..ed2adde63 100644 --- a/src/ecdsa/recovery.rs +++ b/src/ecdsa/recovery.rs @@ -224,7 +224,7 @@ impl Secp256k1 { // The recovery ID is the last byte of the signature. let recovery_id = sp1_ecdsa::RecoveryId::from_byte(sig.0[64]).unwrap(); - let verifying_key = sp1_ecdsa::VerifyingKey::recover_from_prehash_secp256k1(prehash, &signature, recovery_id).unwrap(); + let verifying_key = sp1_ecdsa::VerifyingKey::recover_from_prehash(prehash, &signature, recovery_id).unwrap(); let verifying_key_bytes = { // Convert the verifying key to a byte array. The encoded point returned by `to_encoded_point` is in uncompressed format, // with the prefix byte (0x04) and two 32-byte coordinates in big-endian format. This needs to be flipped to little-endian