Skip to content

Commit

Permalink
Update signature.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
liangping authored Jun 26, 2024
1 parent 5fa454d commit 92bdda3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frost-core/src/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ where

Ok(bytes)
}

pub fn serialize_taproot(signature: &Signature) -> Self::SignatureSerialization {
let R_bytes = Self::Group::serialize(signature.R());
let z_bytes = <Self::Group as Group>::Field::serialize(signature.z());

let mut bytes = [0u8; 64];
bytes[..32].copy_from_slice(&R_bytes[1..]);
bytes[32..].copy_from_slice(&z_bytes);
bytes
}
}

#[cfg(feature = "serde")]
Expand Down

0 comments on commit 92bdda3

Please sign in to comment.