Skip to content

Commit 64d99ed

Browse files
Add ecdsa module to openvm_p256
1 parent f99b6f4 commit 64d99ed

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

guest-libs/p256/guest/Cargo.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@ ecdsa = { workspace = true }
2121
serde = { workspace = true }
2222
hex-literal = { workspace = true }
2323
ff = { workspace = true }
24+
<<<<<<< Updated upstream
25+
=======
26+
<<<<<<< Updated upstream
27+
=======
28+
>>>>>>> Stashed changes
29+
p256 = { workspace = true }
30+
31+
[features]
32+
default = ["ecdsa"]
33+
<<<<<<< Updated upstream
34+
ecdsa = ["p256/ecdsa"]
35+
=======
36+
ecdsa = ["p256/ecdsa", "ecdsa-core"]
37+
ecdsa-core = ["p256/ecdsa-core"]
38+
>>>>>>> Stashed changes
39+
>>>>>>> Stashed changes
2440

2541
[target.'cfg(not(target_os = "zkvm"))'.dependencies]
2642
num-bigint = { workspace = true }

guest-libs/p256/guest/src/ecdsa.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// re-export types that are visible in the p256 crate for API compatibility
2+
3+
pub use p256::ecdsa::Error;
4+
5+
/// ECDSA/secp256k1 signature (fixed-size)
6+
pub type Signature = ecdsa::Signature<crate::P256>;
7+
8+
/// ECDSA/secp256k1 signing key
9+
#[cfg(feature = "ecdsa")]
10+
pub type SigningKey = ecdsa::SigningKey<crate::P256>;
11+
12+
/// ECDSA/secp256k1 verification key (i.e. public key)
13+
#[cfg(feature = "ecdsa")]
14+
pub type VerifyingKey = ecdsa::VerifyingKey<crate::P256>;

guest-libs/p256/guest/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ mod internal;
1313
mod point;
1414
mod scalar;
1515

16+
<<<<<<< Updated upstream
17+
pub mod ecdsa;
18+
19+
=======
20+
<<<<<<< Updated upstream
21+
=======
22+
#[cfg(feature = "ecdsa-core")]
23+
pub mod ecdsa;
24+
25+
>>>>>>> Stashed changes
26+
>>>>>>> Stashed changes
1627
// Needs to be public so that the `sw_init` macro can access it
1728
pub use internal::{
1829
P256Point, P256Point as AffinePoint, P256Point as ProjectivePoint, P256Scalar as Scalar,

0 commit comments

Comments
 (0)