Skip to content

Commit

Permalink
Implement serde for CGGMP21 params (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri authored Jul 18, 2024
2 parents 3bd9680 + 09caea3 commit 3be1339
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions synedrion/src/cggmp21/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use crate::uint::{
U2048Mod, U4096Mod, U512Mod, Zero, U1024, U2048, U4096, U512, U8192,
};

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
use serde::{Deserialize, Serialize};

#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PaillierTest;

impl PaillierParams for PaillierTest {
Expand Down Expand Up @@ -63,7 +65,7 @@ impl PaillierParams for PaillierTest {
type ExtraWideUint = U4096;
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct PaillierProduction;

impl PaillierParams for PaillierProduction {
Expand Down Expand Up @@ -167,7 +169,7 @@ impl<P: SchemeParams> HashableType for P {

/// Scheme parameters **for testing purposes only**.
/// Security is weakened to allow for faster execution.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct TestParams;

// Some requirements from range proofs etc:
Expand All @@ -191,7 +193,7 @@ impl SchemeParams for TestParams {
}

/// Production strength parameters.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProductionParams;

impl SchemeParams for ProductionParams {
Expand Down

0 comments on commit 3be1339

Please sign in to comment.