pub struct Signature(/* private fields */);
Expand description
MultiSig signature, which is a wrapper over the BlstSig
type.
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn verify(
&self,
msg: &[u8],
mvk: &VerificationKey,
) -> Result<(), MultiSignatureError>
pub fn verify( &self, msg: &[u8], mvk: &VerificationKey, ) -> Result<(), MultiSignatureError>
Verify a signature against a verification key.
Sourcepub fn eval(&self, msg: &[u8], index: Index) -> [u8; 64]
pub fn eval(&self, msg: &[u8], index: Index) -> [u8; 64]
Dense mapping function indexed by the index to be evaluated.
We hash the signature to produce a 64 bytes integer.
The return value of this function refers to
ev = H("map" || msg || index || σ) <- MSP.Eval(msg,index,σ)
given in paper.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, MultiSignatureError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, MultiSignatureError>
Convert a string of bytes into a MspSig
.
§Error
Returns an error if the byte string does not represent a point in the curve.
Sourcepub fn aggregate(
vks: &[VerificationKey],
sigs: &[Signature],
) -> Result<(VerificationKey, Signature), MultiSignatureError>
pub fn aggregate( vks: &[VerificationKey], sigs: &[Signature], ) -> Result<(VerificationKey, Signature), MultiSignatureError>
Aggregate a slice of verification keys and Signatures by first hashing the
signatures into random scalars, and multiplying the signature and verification
key with the resulting value. This follows the steps defined in Figure 6,
Aggregate
step.
Sourcepub fn verify_aggregate(
msg: &[u8],
vks: &[VerificationKey],
sigs: &[Signature],
) -> Result<(), MultiSignatureError>
pub fn verify_aggregate( msg: &[u8], vks: &[VerificationKey], sigs: &[Signature], ) -> Result<(), MultiSignatureError>
Verify a set of signatures with their corresponding verification keys using the aggregation mechanism of Figure 6.
Sourcepub fn batch_verify_aggregates(
msgs: &[Vec<u8>],
vks: &[VerificationKey],
sigs: &[Signature],
) -> Result<(), MultiSignatureError>
pub fn batch_verify_aggregates( msgs: &[Vec<u8>], vks: &[VerificationKey], sigs: &[Signature], ) -> Result<(), MultiSignatureError>
Batch verify several sets of signatures with their corresponding verification keys.