pub struct CoreVerifier {
pub eligible_parties: Vec<MerkleTreeLeaf>,
pub total_stake: Stake,
}Expand description
Full node verifier including the list of eligible signers and the total stake of the system.
Fields§
§eligible_parties: Vec<MerkleTreeLeaf>List of registered parties.
total_stake: StakeTotal stake of registered parties.
Implementations§
Source§impl BasicVerifier
impl BasicVerifier
Sourcepub fn new(public_signers: &[(BlsVerificationKey, Stake)]) -> Self
pub fn new(public_signers: &[(BlsVerificationKey, Stake)]) -> Self
Setup a basic verifier for given list of signers. * Collect the unique signers in a hash set, * Calculate the total stake of the eligible signers, * Sort the eligible signers.
Sourcepub fn setup(public_signers: &[(BlsVerificationKey, Stake)]) -> Self
👎Deprecated since 0.5.0: Use new instead
pub fn setup(public_signers: &[(BlsVerificationKey, Stake)]) -> Self
new insteadSetup a basic verifier for given list of signers. * Collect the unique signers in a hash set, * Calculate the total stake of the eligible signers, * Sort the eligible signers.
Sourcepub fn select_valid_signatures_for_k_indices(
total_stake: &Stake,
params: &Parameters,
msg: &[u8],
sigs: &[SingleSignatureWithRegisteredParty],
) -> Result<Vec<SingleSignatureWithRegisteredParty>, AggregationError>
pub fn select_valid_signatures_for_k_indices( total_stake: &Stake, params: &Parameters, msg: &[u8], sigs: &[SingleSignatureWithRegisteredParty], ) -> Result<Vec<SingleSignatureWithRegisteredParty>, AggregationError>
Given a slice of sig_reg_list, this function returns a new list of sig_reg_list with only valid indices.
In case of conflict (having several signatures for the same index)
it selects the smallest signature (i.e. takes the signature with the smallest scalar).
The function selects at least self.k indexes.
§Error
If there is no sufficient signatures, then the function fails.
Sourcepub fn dedup_sigs_for_indices(
total_stake: &Stake,
params: &Parameters,
msg: &[u8],
sigs: &[SingleSignatureWithRegisteredParty],
) -> Result<Vec<SingleSignatureWithRegisteredParty>, AggregationError>
👎Deprecated since 0.5.0: Use select_valid_signatures_for_k_indices instead
pub fn dedup_sigs_for_indices( total_stake: &Stake, params: &Parameters, msg: &[u8], sigs: &[SingleSignatureWithRegisteredParty], ) -> Result<Vec<SingleSignatureWithRegisteredParty>, AggregationError>
select_valid_signatures_for_k_indices insteadGiven a slice of sig_reg_list, this function returns a new list of sig_reg_list with only valid indices.
In case of conflict (having several signatures for the same index)
it selects the smallest signature (i.e. takes the signature with the smallest scalar).
The function selects at least self.k indexes.
§Error
If there is no sufficient signatures, then the function fails.
Sourcepub fn verify(
&self,
signatures: &[SingleSignature],
parameters: &Parameters,
msg: &[u8],
) -> Result<(), CoreVerifierError>
pub fn verify( &self, signatures: &[SingleSignature], parameters: &Parameters, msg: &[u8], ) -> Result<(), CoreVerifierError>
Core verification
Verify a list of signatures with respect to given message with given parameters.