Struct diem_crypto::multi_ed25519::MultiEd25519PublicKey [−][src]
pub struct MultiEd25519PublicKey { /* fields omitted */ }
Expand description
Vector of public keys in the multi-key Ed25519 structure along with the threshold.
Implementations
pub fn new(
public_keys: Vec<Ed25519PublicKey>,
threshold: u8
) -> Result<Self, CryptoMaterialError>
pub fn new(
public_keys: Vec<Ed25519PublicKey>,
threshold: u8
) -> Result<Self, CryptoMaterialError>
Construct a new MultiEd25519PublicKey. — Rules — a) threshold cannot be zero. b) public_keys.len() should be equal to or larger than threshold. c) support up to MAX_NUM_OF_KEYS public keys.
Getter public_keys
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Implementing From<&PrivateKey<…>> allows to derive a public key in a more elegant fashion.
Performs the conversion.
Convenient method to create a MultiEd25519PublicKey from a single Ed25519PublicKey.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
We deduce PublicKey from this.
We require public / private types to be coupled, i.e. their associated type is each other. Read more
Deserialize a MultiEd25519PublicKey. This method will also check for key and threshold validity, and will only deserialize keys that are safe against small subgroup attacks.
type Error = CryptoMaterialError
type Error = CryptoMaterialError
The type returned in the event of a conversion error.
We deduce VerifyingKey from pointing to the signature material
we get the ability to do pubkey.validate(msg, signature)
The associated signing key type for this verifying key.
The associated signature type for this verifying key.
fn verify_struct_signature<T: CryptoHash + Serialize>(
&self,
message: &T,
signature: &Self::SignatureMaterial
) -> Result<()>
fn verify_struct_signature<T: CryptoHash + Serialize>(
&self,
message: &T,
signature: &Self::SignatureMaterial
) -> Result<()>
We provide the striaghtfoward implementation which dispatches to the signature.
fn batch_verify<T: CryptoHash + Serialize>(
message: &T,
keys_and_signatures: Vec<(Self, Self::SignatureMaterial)>
) -> Result<()>
fn batch_verify<T: CryptoHash + Serialize>(
message: &T,
keys_and_signatures: Vec<(Self, Self::SignatureMaterial)>
) -> Result<()>
We provide the implementation which dispatches to the signature.
Auto Trait Implementations
impl RefUnwindSafe for MultiEd25519PublicKey
impl Send for MultiEd25519PublicKey
impl Sync for MultiEd25519PublicKey
impl Unpin for MultiEd25519PublicKey
impl UnwindSafe for MultiEd25519PublicKey
Blanket Implementations
Mutably borrows from an owned value. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
When trying to convert from bytes, we simply decode the string into bytes before checking if we can convert. Read more
A function to encode into hex-string after serializing.