pub struct BlsSigner { /* private fields */ }Expand description
BLS12-381 signer for Ethereum PoS.
Implementations§
Source§impl BlsSigner
impl BlsSigner
Sourcepub fn public_key(&self) -> BlsPublicKey
pub fn public_key(&self) -> BlsPublicKey
Get the public key.
Trait Implementations§
Source§impl KeyPair for BlsSigner
impl KeyPair for BlsSigner
Source§fn generate() -> Result<Self, SignerError>
fn generate() -> Result<Self, SignerError>
Generate a new random key pair using OS entropy (CSPRNG).
Source§fn from_bytes(private_key: &[u8]) -> Result<Self, SignerError>
fn from_bytes(private_key: &[u8]) -> Result<Self, SignerError>
Reconstruct a key pair from raw private key bytes (32 bytes).
Source§fn private_key_bytes(&self) -> Zeroizing<Vec<u8>>
fn private_key_bytes(&self) -> Zeroizing<Vec<u8>>
Export the private key as auto-zeroizing bytes.
The returned
Zeroizing<Vec<u8>> will scrub the memory on drop.Source§impl Signer for BlsSigner
impl Signer for BlsSigner
Source§fn sign_prehashed(&self, digest: &[u8]) -> Result<BlsSignature, SignerError>
fn sign_prehashed(&self, digest: &[u8]) -> Result<BlsSignature, SignerError>
Note: BLS uses hash-to-curve (H2C) internally. This method is identical to
sign() — the digest parameter is treated as a raw message, not a
pre-computed hash. For consistency with the Signer trait, this is provided as-is.
Source§type Signature = BlsSignature
type Signature = BlsSignature
The signature type produced by this signer.
Source§type Error = SignerError
type Error = SignerError
The error type returned on failure.
Source§fn sign(&self, message: &[u8]) -> Result<BlsSignature, SignerError>
fn sign(&self, message: &[u8]) -> Result<BlsSignature, SignerError>
Sign a raw message. The implementation applies chain-specific hashing internally
(e.g., Keccak-256 for Ethereum, double-SHA-256 for Bitcoin).
Auto Trait Implementations§
impl Freeze for BlsSigner
impl RefUnwindSafe for BlsSigner
impl Send for BlsSigner
impl Sync for BlsSigner
impl Unpin for BlsSigner
impl UnsafeUnpin for BlsSigner
impl UnwindSafe for BlsSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more