1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#[cfg(feature = "test-vectors")]
mod test_vectors;
#[cfg(feature = "test-vectors")]
pub use self::test_vectors::SHA256_FIXED_SIZE_TEST_VECTORS;
use super::{WeierstrassCurve, WeierstrassCurveKind};
#[cfg(all(feature = "digest", feature = "sha2"))]
use crate::sha2::Sha256;
use generic_array::typenum::{U32, U33, U64, U65, U73};
#[derive(Copy, Clone, Debug, Default, Eq, Hash, PartialEq, PartialOrd, Ord)]
pub struct Secp256k1;
impl WeierstrassCurve for Secp256k1 {
const CURVE_KIND: WeierstrassCurveKind = WeierstrassCurveKind::Secp256k1;
type ScalarSize = U32;
type CompressedPointSize = U33;
type UntaggedPointSize = U64;
type UncompressedPointSize = U65;
type Asn1SignatureMaxSize = U73;
type FixedSignatureSize = U64;
}
pub type SecretKey = crate::ecdsa::SecretKey<Secp256k1>;
pub type PublicKey = crate::ecdsa::PublicKey<Secp256k1>;
pub type Asn1Signature = crate::ecdsa::Asn1Signature<Secp256k1>;
pub type FixedSignature = crate::ecdsa::FixedSignature<Secp256k1>;
#[cfg(all(feature = "digest", feature = "sha2"))]
impl_digest_signature!(Sha256, Asn1Signature, FixedSignature);