pub struct CachedKeyAgg {
pub context: KeyAggContext,
pub pubkeys: Vec<[u8; 33]>,
}Expand description
Cached key aggregation state for repeated signing with the same key set.
Pre-computes the expensive key aggregation coefficients and aggregate key so they can be reused across multiple signing sessions.
Fields§
§context: KeyAggContextThe underlying key aggregation context.
pubkeys: Vec<[u8; 33]>Cache of the individual public keys.
Implementations§
Source§impl CachedKeyAgg
impl CachedKeyAgg
Sourcepub fn new(pubkeys: &[[u8; 33]]) -> Result<Self, SignerError>
pub fn new(pubkeys: &[[u8; 33]]) -> Result<Self, SignerError>
Create a cached key aggregation from public keys.
This performs the key aggregation once and caches the result for reuse in multiple signing sessions.
Sourcepub fn aggregate_pubkey(&self) -> [u8; 32]
pub fn aggregate_pubkey(&self) -> [u8; 32]
Get the aggregate public key (x-only, 32 bytes).
Sourcepub fn num_signers(&self) -> usize
pub fn num_signers(&self) -> usize
Get the number of signers.
Sourcepub fn contains_key(&self, pubkey: &[u8; 33]) -> bool
pub fn contains_key(&self, pubkey: &[u8; 33]) -> bool
Check if a specific public key is part of this key aggregation.
Trait Implementations§
Source§impl Clone for CachedKeyAgg
impl Clone for CachedKeyAgg
Source§fn clone(&self) -> CachedKeyAgg
fn clone(&self) -> CachedKeyAgg
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CachedKeyAgg
impl RefUnwindSafe for CachedKeyAgg
impl Send for CachedKeyAgg
impl Sync for CachedKeyAgg
impl Unpin for CachedKeyAgg
impl UnsafeUnpin for CachedKeyAgg
impl UnwindSafe for CachedKeyAgg
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