Struct mithril_stm::multi_sig::Signature
source · 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.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Ord for Signature
impl Ord for Signature
source§impl PartialOrd for Signature
impl PartialOrd for Signature
impl Copy for Signature
impl Eq for Signature
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)