Skip to content
This repository has been archived by the owner on Dec 20, 2019. It is now read-only.

Commit

Permalink
remove serde
Browse files Browse the repository at this point in the history
  • Loading branch information
amaloz committed Jun 5, 2019
1 parent 842f1f2 commit f791b97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ base_conversion = { path = "base_conversion" }
itertools = "0.8.0"
rand = "0.6.5"
regex = "1.1.6"
scuttlebutt = { git = "https://github.com/amaloz/scuttlebutt", features = ["serde"], tag = "0.3.0" }
serde = { version = "1.0.90", features = ["derive"] }
scuttlebutt = { git = "https://github.com/amaloz/scuttlebutt", tag = "0.3.0" }

[dev-dependencies]
criterion = "0.2.11"
Expand Down
9 changes: 4 additions & 5 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
use crate::dummy::DummyVal;
use crate::error::{CircuitBuilderError, DummyError, FancyError, InformerError};
use crate::fancy::{BinaryBundle, CrtBundle, Fancy, FancyInput, HasModulus};
use crate::informer::InformerVal;
use itertools::Itertools;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use crate::informer::InformerVal;

/// The index and modulus of a gate in a circuit.
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct CircuitRef {
pub(crate) ix: usize,
pub(crate) modulus: u16,
Expand All @@ -29,7 +28,7 @@ impl HasModulus for CircuitRef {
}

/// Static representation of the type of computation supported by fancy garbling.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub struct Circuit {
pub(crate) gates: Vec<Gate>,
pub(crate) gate_moduli: Vec<u16>,
Expand All @@ -41,7 +40,7 @@ pub struct Circuit {
}

/// The most basic types of computation supported by fancy garbling.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub(crate) enum Gate {
GarblerInput {
id: usize,
Expand Down
5 changes: 2 additions & 3 deletions src/static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ use crate::garble::{Evaluator, Garbler};
use crate::wire::Wire;
use itertools::Itertools;
use scuttlebutt::{AbstractChannel, AesRng, Block, Channel};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::convert::TryInto;
use std::rc::Rc;

/// Static evaluator for a circuit, created by the `garble` function.
///
/// Uses `Evaluator` under the hood to actually implement the evaluation.
#[derive(Serialize, Deserialize, PartialEq, Debug)]
#[derive(Debug)]
pub struct GarbledCircuit {
blocks: Vec<Block>,
}
Expand Down Expand Up @@ -102,7 +101,7 @@ pub fn garble(c: &mut Circuit) -> Result<(Encoder, GarbledCircuit), GarblerError
// Encoder

/// Encode inputs statically.
#[derive(Serialize, Deserialize, PartialEq, Debug)]
#[derive(Debug)]
pub struct Encoder {
garbler_inputs: Vec<Wire>,
evaluator_inputs: Vec<Wire>,
Expand Down
3 changes: 1 addition & 2 deletions src/wire.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ use crate::fancy::HasModulus;
use crate::util;
use rand::{CryptoRng, Rng, RngCore};
use scuttlebutt::{Block, AES_HASH};
use serde::{Deserialize, Serialize};

/// The core wire-label type.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[derive(Debug, Clone, PartialEq)]
pub enum Wire {
/// Representation of a `mod-2` wire.
Mod2 {
Expand Down

0 comments on commit f791b97

Please sign in to comment.