Skip to content

Commit

Permalink
Make the trait AggregateableSignatureScheme inherit from (De)Serialize.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippecamacho committed May 24, 2023
1 parent 839ac6a commit 29739c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions primitives/src/signatures/bls_over_bn254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ use ark_ff::{
field_hashers::{DefaultFieldHasher, HashToField},
BigInteger, Field, PrimeField,
};
use ark_serialize::*;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, *};
use ark_std::{
format,
hash::{Hash, Hasher},
Expand All @@ -58,6 +58,7 @@ use ark_std::{
One, UniformRand,
};
use digest::DynDigest;
use serde::{Deserialize, Serialize};
use sha3::Keccak256;

use crate::errors::PrimitivesError::{ParameterError, VerificationError};
Expand All @@ -67,7 +68,7 @@ use tagged_base64::tagged;
use zeroize::Zeroize;

/// BLS signature scheme.
#[derive(CanonicalSerialize, CanonicalDeserialize)]
#[derive(Serialize, Deserialize)]
pub struct BLSOverBN254CurveSignatureScheme;

impl SignatureScheme for BLSOverBN254CurveSignatureScheme {
Expand Down
4 changes: 3 additions & 1 deletion primitives/src/signatures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ pub trait SignatureScheme {

/// Trait for aggregatable signatures.
/// TODO: generic over hash functions
pub trait AggregateableSignatureSchemes: SignatureScheme {
pub trait AggregateableSignatureSchemes:
SignatureScheme + Serialize + for<'a> Deserialize<'a>
{
/// Aggregate multiple signatures into a single signature
/// The list of public keys is also in the input as some aggregate signature
/// schemes might also use pks for aggregation
Expand Down

0 comments on commit 29739c7

Please sign in to comment.