Skip to content

Commit 09b0456

Browse files
committed
Add schnorrsig module
1 parent 47b3382 commit 09b0456

File tree

4 files changed

+721
-1
lines changed

4 files changed

+721
-1
lines changed

src/constants.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ pub const MAX_SIGNATURE_SIZE: usize = 72;
3434
/// The maximum size of a compact signature
3535
pub const COMPACT_SIGNATURE_SIZE: usize = 64;
3636

37+
/// Size of a Schnorr signature
38+
pub const SCHNORRSIG_SIGNATURE_SIZE: usize = 64;
39+
40+
/// Size of a Schnorr public key
41+
pub const SCHNORRSIG_PUBLIC_KEY_SIZE: usize = 32;
42+
43+
/// Size of a key pair
44+
pub const KEY_PAIR_SIZE: usize = 96;
45+
3746
/// The Prime for the secp256k1 field element.
3847
pub const FIELD_SIZE: [u8; 32] = [
3948
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ mod context;
142142
pub mod constants;
143143
pub mod ecdh;
144144
pub mod key;
145+
pub mod schnorrsig;
145146
#[cfg(feature = "recovery")]
146147
pub mod recovery;
147148

src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ macro_rules! serde_impl(
6767

6868
if d.is_human_readable() {
6969
let sl: &str = ::serde::Deserialize::deserialize(d)?;
70-
SecretKey::from_str(sl).map_err(D::Error::custom)
70+
$t::from_str(sl).map_err(D::Error::custom)
7171
} else {
7272
let sl: &[u8] = ::serde::Deserialize::deserialize(d)?;
7373
if sl.len() != $len {

0 commit comments

Comments
 (0)