Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serde support for Aggregateable signatures #271

Merged
merged 4 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and follow [semantic versioning](https://semver.org/) for our releases.
- [#234](https://github.com/EspressoSystems/jellyfish/pull/234) New `bytes_from_field_elements` util
- [#231](https://github.com/EspressoSystems/jellyfish/pull/231) Implemented FK23 for fast amortized opening for univariate PCS
- [#254](https://github.com/EspressoSystems/jellyfish/pull/254) Ensure `no_std` and target WASM support
- [#271](https://github.com/EspressoSystems/jellyfish/pull/271) Serde support for Aggregateable signatures

### Changed

Expand Down
4 changes: 3 additions & 1 deletion 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,6 +68,7 @@ use tagged_base64::tagged;
use zeroize::Zeroize;

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

impl SignatureScheme for BLSOverBN254CurveSignatureScheme {
Expand Down
6 changes: 4 additions & 2 deletions primitives/src/signatures/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub trait SignatureScheme {
+ Eq;

/// Public Parameter
type PublicParameter;
type PublicParameter: for<'a> Deserialize<'a> + Serialize;

/// Signature
type Signature: Debug
Expand Down 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