[−][src]Trait bls_like::pop::ProofsOfPossession
Proof-of-possession table.
We provide a signers bitfield for efficent
Associated Types
type Signers: Borrow<[u8]> + BorrowMut<[u8]> + Clone + Sized
Bitfield type used to represent a signers set
Must not permit altering length, so Box<[u8]>
or [u8; 128]
not Vec<u8>
.
Required methods
fn agreement(&self, other: &Self) -> bool
Returns true if two ProofsOfPossession databases match exactly.
We could employ a PartialEq
fn new_signers(&self) -> Self::Signers
Create a new signers set bitfield
fn lookup(&self, index: usize) -> Option<PublicKey<E>>
Lookup the public key with a particular bit index.
Must succeed if index < signers.borrow().len()
, but
should panic if index > signers.borrow().len()
.
It may return None
if the position is empty.
Must satisfy self.lookup(i).and_then(|i| self.find(i)) == Some(i)
when i
is occupied.
fn find(&self, publickey: &PublicKey<E>) -> Option<usize>
Find the bit index for a particular public key.
Must succeed if the public key is present, and fail otherwise.
Must satisfy self.find(pk).and_then(|i| self.lookup(i)) == Some(pk)
when pk
is present.
Implementors
impl<E, V> ProofsOfPossession<E> for V where
E: EngineBLS,
V: Deref<Target = [PublicKey<E>]>,
[src]
E: EngineBLS,
V: Deref<Target = [PublicKey<E>]>,
Avoiding duplicate keys inside a slice gets costly. We suggest improving performance by using a customized data type.
TODO: Evaluate using Deref vs Borrow in this context TODO: Use specialization here