Skip to content

Commit

Permalink
allow serde by default
Browse files Browse the repository at this point in the history
  • Loading branch information
shamatar committed Jun 23, 2022
1 parent 07480cf commit 0aa1189
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rand = "0.4"
bit-vec = "0.6"
cfg-if = "1.*"

pairing = {package = "pairing_ce", version = "0.26.*" }
pairing = {package = "pairing_ce", version = "0.28.*" }
# pairing = {package = "pairing_ce", path = "../pairing"}
byteorder = "1"

Expand All @@ -38,6 +38,8 @@ blake2s_const = {version = "0.6", optional = true, path = "./src/plonk/blake2_co

hex = "*"

serde = {version = "1", features = ["derive"]}

[features]
default = ["multicore", "plonk"]
multicore = ["crossbeam", "futures/thread-pool"]
Expand Down
2 changes: 1 addition & 1 deletion src/plonk/transparent_engine/impl_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ macro_rules! transparent_engine_impl {
$engine:ident,
$fr:ty
) => {
#[derive(Clone, Debug)]
#[derive(Clone, Copy, Debug)]
pub struct $engine;

impl crate::ff::ScalarEngine for $engine {
Expand Down
4 changes: 2 additions & 2 deletions src/plonk/transparent_engine/proth.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use crate::ff::*;
use super::{PartialReductionField, PartialTwoBitReductionField};

#[derive(Copy, Clone, PartialEq, Eq, Default, Hash)]
#[derive(Copy, Clone, PartialEq, Eq, Default, Hash, ::serde::Serialize, ::serde::Deserialize)]
pub struct FrRepr(pub [u64; 4usize]);

#[derive(Hash)]
#[derive(Hash, ::serde::Serialize, ::serde::Deserialize)]
pub struct Fr(FrRepr);

// const MODULUS: FrRepr = FrRepr([1u64, 0u64, 0u64, 576460752303423505u64]);
Expand Down
6 changes: 3 additions & 3 deletions src/tests/dummy_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use std::num::Wrapping;

const MODULUS_R: Wrapping<u32> = Wrapping(64513);

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, ::serde::Serialize, ::serde::Deserialize)]
pub struct Fr(Wrapping<u32>);

impl fmt::Display for Fr {
Expand Down Expand Up @@ -160,7 +160,7 @@ impl SqrtField for Fr {
}
}

#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, ::serde::Serialize, ::serde::Deserialize)]
pub struct FrRepr([u64; 1]);

impl Ord for FrRepr {
Expand Down Expand Up @@ -300,7 +300,7 @@ impl PrimeField for Fr {
}
}

#[derive(Clone, Debug)]
#[derive(Clone, Copy, Debug)]
pub struct DummyEngine;

impl ScalarEngine for DummyEngine {
Expand Down

0 comments on commit 0aa1189

Please sign in to comment.