pub enum AggregateSignature<D: MembershipDigest> {
Concatenation(Box<ConcatenationProof<D>>),
}Expand description
An STM aggregate signature.
Variants§
Implementations§
Source§impl<D: MembershipDigest> AggregateSignature<D>
impl<D: MembershipDigest> AggregateSignature<D>
Sourcepub fn verify(
&self,
msg: &[u8],
avk: &AggregateVerificationKey<D>,
parameters: &Parameters,
) -> StmResult<()>
pub fn verify( &self, msg: &[u8], avk: &AggregateVerificationKey<D>, parameters: &Parameters, ) -> StmResult<()>
Verify an aggregate signature.
Sourcepub fn batch_verify(
aggregate_signatures: &[Self],
msgs: &[Vec<u8>],
avks: &[AggregateVerificationKey<D>],
parameters: &[Parameters],
) -> StmResult<()>
pub fn batch_verify( aggregate_signatures: &[Self], msgs: &[Vec<u8>], avks: &[AggregateVerificationKey<D>], parameters: &[Parameters], ) -> StmResult<()>
Batch verify a set of aggregate signatures.
Sourcepub fn to_bytes(&self) -> StmResult<Vec<u8>>
pub fn to_bytes(&self) -> StmResult<Vec<u8>>
Convert an aggregate signature to CBOR bytes with a version prefix.
Uses a type-discriminated envelope to work around the #[serde(untagged)]
attribute which is incompatible with ciborium’s CBOR deserialization.
Sourcepub fn from_bytes(bytes: &[u8]) -> StmResult<Self>
pub fn from_bytes(bytes: &[u8]) -> StmResult<Self>
Extract an aggregate signature from a byte slice.
Supports both the legacy type-prefix byte format and the new
versioned CBOR format. Because the legacy Snark type prefix is 0x01
(same as the CBOR version byte), this method uses try-CBOR-then-fallback
when the first byte is 0x01.
Note: if a valid CBOR payload is corrupted in transit, CBOR decoding will fail and the legacy decoder may accept the corrupted bytes as a structurally valid (but semantically garbage) proof. This is acceptable because the resulting proof will always fail cryptographic verification.
Sourcepub fn to_concatenation_proof(&self) -> Option<&ConcatenationProof<D>>
pub fn to_concatenation_proof(&self) -> Option<&ConcatenationProof<D>>
If the aggregate signature is a concatenation proof, return it.
Trait Implementations§
Source§impl<D: Clone + MembershipDigest> Clone for AggregateSignature<D>
impl<D: Clone + MembershipDigest> Clone for AggregateSignature<D>
Source§fn clone(&self) -> AggregateSignature<D>
fn clone(&self) -> AggregateSignature<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more