pub struct StmInitializer {
pub stake: Stake,
pub params: Parameters,
/* private fields */
}
Expand description
Initializer for Signer
.
This is the data that is used during the key registration procedure.
Once the latter is finished, this instance is consumed into an Signer
.
Fields§
§stake: Stake
This participant’s stake.
params: Parameters
Current protocol instantiation parameters.
Implementations§
Source§impl Initializer
impl Initializer
Sourcepub fn new<R: RngCore + CryptoRng>(
params: Parameters,
stake: Stake,
rng: &mut R,
) -> Self
pub fn new<R: RngCore + CryptoRng>( params: Parameters, stake: Stake, rng: &mut R, ) -> Self
Builds an Initializer
that is ready to register with the key registration service.
This function generates the signing and verification key with a PoP, and initialises the structure.
Sourcepub fn setup<R: RngCore + CryptoRng>(
params: Parameters,
stake: Stake,
rng: &mut R,
) -> Self
👎Deprecated since 0.4.9: Use new
instead
pub fn setup<R: RngCore + CryptoRng>( params: Parameters, stake: Stake, rng: &mut R, ) -> Self
new
insteadBuilds an Initializer
that is ready to register with the key registration service.
This function generates the signing and verification key with a PoP, and initialises the structure.
Sourcepub fn get_verification_key_proof_of_possession(
&self,
) -> VerificationKeyProofOfPossession
pub fn get_verification_key_proof_of_possession( &self, ) -> VerificationKeyProofOfPossession
Extract the verification key with proof of possession.
Sourcepub fn verification_key(&self) -> VerificationKeyProofOfPossession
👎Deprecated since 0.4.9: Use get_verification_key_proof_of_possession
instead
pub fn verification_key(&self) -> VerificationKeyProofOfPossession
get_verification_key_proof_of_possession
insteadExtract the verification key.
Sourcepub fn create_signer<D: Digest + Clone + FixedOutput>(
self,
closed_reg: ClosedKeyRegistration<D>,
) -> Result<Signer<D>, RegisterError>
pub fn create_signer<D: Digest + Clone + FixedOutput>( self, closed_reg: ClosedKeyRegistration<D>, ) -> Result<Signer<D>, RegisterError>
Build the avk
for the given list of parties.
Note that if this Initializer was modified between the last call to register
,
then the resulting Signer
may not be able to produce valid signatures.
Returns an Signer
specialized to
- this
Signer
’s ID and current stake - this
Signer
’s parameter valuation - the
avk
as built from the current registered parties (according to the registration service) - the current total stake (according to the registration service)
§Error
This function fails if the initializer is not registered.
Sourcepub fn new_signer<D: Digest + Clone + FixedOutput>(
self,
closed_reg: ClosedKeyRegistration<D>,
) -> Result<Signer<D>, RegisterError>
👎Deprecated since 0.4.9: Use create_signer
instead
pub fn new_signer<D: Digest + Clone + FixedOutput>( self, closed_reg: ClosedKeyRegistration<D>, ) -> Result<Signer<D>, RegisterError>
create_signer
insteadBuild the avk
for the given list of parties.
Note that if this Initializer was modified between the last call to register
,
then the resulting Signer
may not be able to produce valid signatures.
Returns an Signer
specialized to
- this
Signer
’s ID and current stake - this
Signer
’s parameter valuation - the
avk
as built from the current registered parties (according to the registration service) - the current total stake (according to the registration service)
§Error
This function fails if the initializer is not registered.
Sourcepub fn create_basic_signer<D: Digest + Clone + FixedOutput>(
self,
eligible_parties: &[MerkleTreeLeaf],
) -> Option<Signer<D>>
pub fn create_basic_signer<D: Digest + Clone + FixedOutput>( self, eligible_parties: &[MerkleTreeLeaf], ) -> Option<Signer<D>>
Creates a new basic signer that does not include closed registration.
Takes eligible_parties
as a parameter and determines the signer’s index in the parties.
eligible_parties
is verified and trusted which is only run by a full-node
that has already verified the parties.
Sourcepub fn new_core_signer<D: Digest + Clone + FixedOutput>(
self,
eligible_parties: &[MerkleTreeLeaf],
) -> Option<Signer<D>>
👎Deprecated since 0.4.9: Use create_basic_signer
instead
pub fn new_core_signer<D: Digest + Clone + FixedOutput>( self, eligible_parties: &[MerkleTreeLeaf], ) -> Option<Signer<D>>
create_basic_signer
insteadCreates a new basic signer that does not include closed registration.
Takes eligible_parties
as a parameter and determines the signer’s index in the parties.
eligible_parties
is verified and trusted which is only run by a full-node
that has already verified the parties.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Initializer, RegisterError>
pub fn from_bytes(bytes: &[u8]) -> Result<Initializer, RegisterError>
Convert a slice of bytes to an Initializer
§Error
The function fails if the given string of bytes is not of required size.
Trait Implementations§
Source§impl Clone for Initializer
impl Clone for Initializer
Source§fn clone(&self) -> Initializer
fn clone(&self) -> Initializer
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more