Type Alias BLSPubKey

Source
pub type BLSPubKey = VerKey;
Expand description

BLS public key used to verify a consensus signature

Aliased Type§

struct BLSPubKey(/* private fields */);

Trait Implementations§

Source§

impl SignatureKey for BLSPubKey

Source§

type PrivateKey = SignKey

The private key type for this signature algorithm
Source§

type StakeTableEntry = StakeTableEntry<VerKey>

The type of the entry that contain both public key and stake value
Source§

type QcParams<'a> = QcParams<'a, VerKey, <BLSOverBN254CurveSignatureScheme as SignatureScheme>::PublicParameter>

The type of the quorum certificate parameters used for assembled signature
Source§

type PureAssembledSignatureType = <BLSOverBN254CurveSignatureScheme as SignatureScheme>::Signature

The type of the assembled signature, without BitVec
Source§

type QcType = (<VerKey as SignatureKey>::PureAssembledSignatureType, BitVec)

The type of the assembled qc: assembled signature + BitVec
Source§

type SignError = SignatureError

Type of error that can occur when signing data
Source§

fn validate( &self, signature: &Self::PureAssembledSignatureType, data: &[u8], ) -> bool

Validate a signature
Source§

fn sign( sk: &Self::PrivateKey, data: &[u8], ) -> Result<Self::PureAssembledSignatureType, Self::SignError>

Produce a signature Read more
Source§

fn from_private(private_key: &Self::PrivateKey) -> Self

Produce a public key from a private key
Source§

fn to_bytes(&self) -> Vec<u8>

Serialize a public key to bytes
Source§

fn from_bytes(bytes: &[u8]) -> Result<Self, SerializationError>

Deserialize a public key from bytes Read more
Source§

fn generated_from_seed_indexed( seed: [u8; 32], index: u64, ) -> (Self, Self::PrivateKey)

Generate a new key pair
Source§

fn stake_table_entry(&self, stake: U256) -> Self::StakeTableEntry

get the stake table entry from the public key and stake value
Source§

fn public_key(entry: &Self::StakeTableEntry) -> Self

only get the public key from the stake table entry
Source§

fn public_parameter( stake_entries: &[Self::StakeTableEntry], threshold: U256, ) -> Self::QcParams<'_>

get the public parameter for the assembled signature checking
Source§

fn check( real_qc_pp: &Self::QcParams<'_>, data: &[u8], qc: &Self::QcType, ) -> Result<(), SignatureError>

check the quorum certificate for the assembled signature, returning Ok(()) if it is valid. Read more
Source§

fn sig_proof( signature: &Self::QcType, ) -> (Self::PureAssembledSignatureType, BitVec)

get the assembled signature and the BitVec separately from the assembled signature
Source§

fn assemble( real_qc_pp: &Self::QcParams<'_>, signers: &BitSlice, sigs: &[Self::PureAssembledSignatureType], ) -> Self::QcType

assemble the signature from the partial signature and the indication of signers in BitVec
Source§

fn genesis_proposer_pk() -> Self

generates the genesis public key. Meant to be dummy/filler
Source§

impl ToFieldsLightClientCompat for BLSPubKey

Source§

fn to_fields(&self) -> Vec<CircuitField>

This should be compatible with our legacy implementation.

Source§

const SIZE: usize = 3usize