1pub use ecdsa_core::signature::{self, Error};
7#[cfg(feature = "ecdsa")]
8use openvm_ecc_guest::ecdsa::VerifyCustomHook;
9#[cfg(feature = "ecdsa")]
10use {super::P256Point, ecdsa_core::hazmat::VerifyPrimitive};
11
12use super::NistP256;
13
14pub type Signature = ecdsa_core::Signature<NistP256>;
16
17#[cfg(feature = "ecdsa")]
19pub type SigningKey = ecdsa_core::SigningKey<NistP256>;
20
21#[cfg(feature = "ecdsa")]
23pub type VerifyingKey = openvm_ecc_guest::ecdsa::VerifyingKey<NistP256>;
24
25#[cfg(feature = "ecdsa")]
27impl VerifyCustomHook<NistP256> for P256Point {}
28
29#[cfg(feature = "ecdsa")]
30impl VerifyPrimitive<NistP256> for P256Point {
31 fn verify_prehashed(
32 &self,
33 z: &crate::point::FieldBytes,
34 sig: &Signature,
35 ) -> Result<(), ecdsa_core::Error> {
36 openvm_ecc_guest::ecdsa::verify_prehashed::<NistP256>(
37 *self,
38 z.as_slice(),
39 sig.to_bytes().as_slice(),
40 )
41 .map_err(|_| ecdsa_core::Error::new())
42 }
43}