Skip to content

Commit

Permalink
Delete share_of_one module
Browse files Browse the repository at this point in the history
  • Loading branch information
akoshelev committed Nov 18, 2022
1 parent d97a580 commit e086292
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/protocol/context/malicious.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ impl<'a, F: Field> MaliciousProtocolContext<'a, F> {
}
}

pub fn r_share(&self) -> &Replicated<F> {
&self.r_share
}

pub fn accumulator(&self) -> SecurityValidatorAccumulator<F> {
self.accumulator.clone()
}
Expand Down Expand Up @@ -98,4 +94,8 @@ impl<'a, F: Field> ProtocolContext<F> for MaliciousProtocolContext<'a, F> {
fn mesh(&self) -> Mesh<'_, '_> {
self.inner.gateway.mesh(self.step())
}

fn share_of_one(&self) -> <Self as ProtocolContext<F>>::Share {
MaliciousReplicated::one(self.role(), self.r_share.clone())
}
}
6 changes: 4 additions & 2 deletions src/protocol/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ use crate::protocol::prss::{
Endpoint as PrssEndpoint, IndexedSharedRandomness, SequentialSharedRandomness,
};
use crate::protocol::reveal::Reveal;
use crate::protocol::share_of_one::ShareOfOne;
use crate::protocol::{Step, Substep};
use crate::secret_sharing::SecretSharing;
use std::sync::Arc;
Expand All @@ -22,7 +21,7 @@ pub use semi_honest::SemiHonestProtocolContext;
pub trait ProtocolContext<F: Field>:
Clone
+ SecureMul<F, Share = <Self as ProtocolContext<F>>::Share>
+ ShareOfOne<F, Share = <Self as ProtocolContext<F>>::Share>
// + ShareOfOne<F, Share = <Self as ProtocolContext<F>>::Share>
+ Reveal
{
/// Secret sharing type this context supports.
Expand Down Expand Up @@ -61,6 +60,9 @@ pub trait ProtocolContext<F: Field>:
/// Get a set of communications channels to different peers.
#[must_use]
fn mesh(&self) -> Mesh<'_, '_>;

/// Generates a new share of one
fn share_of_one(&self) -> <Self as ProtocolContext<F>>::Share;
}

/// Contains things that are applicable to any implementation of protocol context as see it today
Expand Down
4 changes: 4 additions & 0 deletions src/protocol/context/semi_honest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ impl<'a, F: Field> ProtocolContext<F> for SemiHonestProtocolContext<'a, F> {
fn mesh(&self) -> Mesh<'_, '_> {
self.inner.gateway.mesh(self.step())
}

fn share_of_one(&self) -> <Self as ProtocolContext<F>>::Share {
Replicated::one(self.role())
}
}
1 change: 0 additions & 1 deletion src/protocol/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ mod modulus_conversion;
pub mod mul;
pub mod prss;
mod reveal;
pub mod share_of_one;
pub mod sort;

use crate::error::Error;
Expand Down
28 changes: 0 additions & 28 deletions src/protocol/share_of_one.rs

This file was deleted.

0 comments on commit e086292

Please sign in to comment.