[−][src]Trait bls_signatures_rs::MultiSignature
The MultiSignature
trait specifies an interface common for curves with multi signature support.
This trait requires to define the types for PublicKey
, SecretKey
and Signature
.
Associated Types
type Error
Required methods
fn derive_public_key(
&mut self,
secret_key: SecretKey
) -> Result<Vec<u8>, Self::Error>
&mut self,
secret_key: SecretKey
) -> Result<Vec<u8>, Self::Error>
Function to derive public key given a secret key.
Arguments
secret_key
- The secret key to derive the public key
Returns
- If successful, a vector of bytes with the public key
fn sign(
&mut self,
secret_key: SecretKey,
message: &[u8]
) -> Result<Vec<u8>, Self::Error>
&mut self,
secret_key: SecretKey,
message: &[u8]
) -> Result<Vec<u8>, Self::Error>
Function to sign a message given a private key.
Arguments
message
- The message to be signedsecret_key
- The secret key for signing
Returns
- If successful, a vector of bytes with the signature
fn verify(
&mut self,
signature: Signature,
message: &[u8],
public_key: PublicKey
) -> Result<(), Self::Error>
&mut self,
signature: Signature,
message: &[u8],
public_key: PublicKey
) -> Result<(), Self::Error>
Function to verify a signature given a public key.
Arguments
signature
- The signaturemessage
- The message to be signedpublic_key
- The public key to verify
Returns
- If successful,
Ok(())
; otherwiseError
fn aggregate_public_keys(
&mut self,
public_keys: &[PublicKey]
) -> Result<Vec<u8>, Self::Error>
&mut self,
public_keys: &[PublicKey]
) -> Result<Vec<u8>, Self::Error>
Function to aggregate public keys in their corresponding group.
Arguments
public_key
- An array of public keys to be aggregated
Returns
- If successful, a vector of bytes with the aggregated public key
fn aggregate_signatures(
&mut self,
signatures: &[Signature]
) -> Result<Vec<u8>, Self::Error>
&mut self,
signatures: &[Signature]
) -> Result<Vec<u8>, Self::Error>
Implementors
impl<'_, '_, '_> MultiSignature<&'_ [u8], &'_ [u8], &'_ [u8]> for Bn256
[src]
type Error = Error
fn derive_public_key(&mut self, secret_key: &[u8]) -> Result<Vec<u8>, Error>
[src]
Function to derive public key (point in G2) given a secret key.
Arguments
secret_key
- The secret key bytes
Returns
- If successful, a vector of bytes with the public key
fn sign(
&mut self,
secret_key: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Self::Error>
[src]
&mut self,
secret_key: &[u8],
message: &[u8]
) -> Result<Vec<u8>, Self::Error>
Function to sign a message given a private key (as a point in G1).
Arguments
message
- The message bytessecret_key
- The secret key bytes
Returns
- If successful, a vector of bytes with the signature
fn verify(
&mut self,
signature: &[u8],
message: &[u8],
public_key: &[u8]
) -> Result<(), Self::Error>
[src]
&mut self,
signature: &[u8],
message: &[u8],
public_key: &[u8]
) -> Result<(), Self::Error>
Function to verify a signature (point in G1) given a public key (point in G2).
Arguments
signature
- The signature bytesmessage
- The message to be signedpublic_key
- The public key bytes
Returns
- If successful,
Ok(())
; otherwiseError
fn aggregate_public_keys(
&mut self,
public_keys: &[&[u8]]
) -> Result<Vec<u8>, Self::Error>
[src]
&mut self,
public_keys: &[&[u8]]
) -> Result<Vec<u8>, Self::Error>
Function to aggregate public keys (sum of points in G2).
Arguments
public_keys
- An array of public key bytes to be aggregated
Returns
- If successful, a vector of bytes with the aggregated public key
fn aggregate_signatures(
&mut self,
signatures: &[&[u8]]
) -> Result<Vec<u8>, Self::Error>
[src]
&mut self,
signatures: &[&[u8]]
) -> Result<Vec<u8>, Self::Error>