pub struct SharePackage {
pub metadata: ShareMetadata,
/* private fields */
}Expand description
A FROST key share with metadata.
Contains the secret key package (zeroized on drop) and public key package.
Fields§
§metadata: ShareMetadataShare metadata.
Implementations§
Sourcepub fn new(
metadata: ShareMetadata,
key_package: &KeyPackage,
pubkey_package: &PublicKeyPackage,
) -> Result<Self>
pub fn new( metadata: ShareMetadata, key_package: &KeyPackage, pubkey_package: &PublicKeyPackage, ) -> Result<Self>
Create a new share package from FROST key packages.
Sourcepub fn from_bytes(
metadata: ShareMetadata,
key_package_bytes: Vec<u8>,
pubkey_package_bytes: Vec<u8>,
) -> Self
pub fn from_bytes( metadata: ShareMetadata, key_package_bytes: Vec<u8>, pubkey_package_bytes: Vec<u8>, ) -> Self
Create a share package from already-serialized package bytes.
Used by ciphersuites whose package types are not the secp256k1 ones.
Sourcepub fn key_package_bytes(&self) -> &[u8] ⓘ
pub fn key_package_bytes(&self) -> &[u8] ⓘ
The serialized key package bytes.
Sourcepub fn pubkey_package_bytes(&self) -> &[u8] ⓘ
pub fn pubkey_package_bytes(&self) -> &[u8] ⓘ
The serialized public key package bytes.
Sourcepub fn key_package(&self) -> Result<KeyPackage>
pub fn key_package(&self) -> Result<KeyPackage>
Deserialize and return the key package.
Sourcepub fn pubkey_package(&self) -> Result<PublicKeyPackage>
pub fn pubkey_package(&self) -> Result<PublicKeyPackage>
Deserialize and return the public key package.
Sourcepub fn identifier(&self) -> Result<Identifier>
pub fn identifier(&self) -> Result<Identifier>
The FROST identifier for this share.
Sourcepub fn group_pubkey(&self) -> &[u8; 32]
pub fn group_pubkey(&self) -> &[u8; 32]
The group public key.
Sourcepub fn verified_group_pubkey(&self) -> Result<[u8; 32]>
pub fn verified_group_pubkey(&self) -> Result<[u8; 32]>
The group public key read from the public-key package’s verifying key,
as opposed to the separate metadata.group_pubkey field. Use this to
detect a share loaded from an untrusted store that belongs to a
different group (or is corrupted) than the key it was requested under.
This compares the package’s advertised verifying key, which is public data and an independently-settable field, so it is NOT proof that the share carries a valid secret for that group: a store could pair the expected verifying key with junk key material. That case is caught later at signing time (the partial signatures will not aggregate), not here.