mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-26 09:13:41 +00:00
Expose blst internals (#6829)
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::{
|
||||
GenericPublicKey, TPublicKey, PUBLIC_KEY_BYTES_LEN, PUBLIC_KEY_UNCOMPRESSED_BYTES_LEN,
|
||||
},
|
||||
generic_secret_key::TSecretKey,
|
||||
generic_signature::{TSignature, SIGNATURE_BYTES_LEN},
|
||||
generic_signature::{TSignature, SIGNATURE_BYTES_LEN, SIGNATURE_UNCOMPRESSED_BYTES_LEN},
|
||||
BlstError, Error, Hash256, ZeroizeHash, INFINITY_SIGNATURE,
|
||||
};
|
||||
pub use blst::min_pk as blst_core;
|
||||
@@ -189,10 +189,18 @@ impl TSignature<blst_core::PublicKey> for blst_core::Signature {
|
||||
self.to_bytes()
|
||||
}
|
||||
|
||||
fn serialize_uncompressed(&self) -> [u8; SIGNATURE_UNCOMPRESSED_BYTES_LEN] {
|
||||
self.serialize()
|
||||
}
|
||||
|
||||
fn deserialize(bytes: &[u8]) -> Result<Self, Error> {
|
||||
Self::from_bytes(bytes).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn deserialize_uncompressed(bytes: &[u8]) -> Result<Self, Error> {
|
||||
Self::deserialize(bytes).map_err(Into::into)
|
||||
}
|
||||
|
||||
fn verify(&self, pubkey: &blst_core::PublicKey, msg: Hash256) -> bool {
|
||||
// Public keys have already been checked for subgroup and infinity
|
||||
// Check Signature inside function for subgroup
|
||||
|
||||
Reference in New Issue
Block a user