Skip to content

Commit

Permalink
Merge pull request #854 from richajaindce/remove_test_only_from_boolean
Browse files Browse the repository at this point in the history
Removing test config for all functions needed for convert_to_fp25519
  • Loading branch information
benjaminsavage authored Nov 24, 2023
2 parents 9b7e433 + aa3c8f1 commit 24a2018
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
9 changes: 5 additions & 4 deletions src/helpers/gateway/stall_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ impl<T: ObserveState> Observed<T> {
}

mod gateway {

use delegate::delegate;

use super::*;
use super::{receive, send, AtomicUsize, Debug, Formatter, ObserveState, Observed, Weak};
use crate::{
helpers::{
gateway::{Gateway, State},
Expand Down Expand Up @@ -126,7 +127,7 @@ mod gateway {
let mut last_sn_seen = 0;
loop {
::tokio::time::sleep(config.progress_check_interval).await;
let now = gateway.get_sn().upgrade().map(|v| v.load(Ordering::Relaxed));
let now = gateway.get_sn().upgrade().map(|v| v.load(core::sync::atomic::Ordering::Relaxed));
if let Some(now) = now {
if now == last_sn_seen {
if let Some(state) = gateway.get_state() {
Expand Down Expand Up @@ -215,7 +216,7 @@ mod receive {
fmt::{Debug, Formatter},
};

use super::*;
use super::{ObserveState, Observed};
use crate::{
helpers::{
error::Error,
Expand Down Expand Up @@ -273,7 +274,7 @@ mod send {
fmt::{Debug, Formatter},
};

use super::*;
use super::{ObserveState, Observed};
use crate::{
helpers::{
error::Error,
Expand Down
15 changes: 4 additions & 11 deletions src/protocol/ipa_prf/boolean_ops/addition_sequential.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
#[cfg(all(test, unit_test))]
use ipa_macros::Step;

#[cfg(all(test, unit_test))]
use crate::{
error::Error,
ff::{ArrayAccess, CustomArray, Field},
protocol::{
basics::{if_else, SecureMul},
context::Context,
step::BitOpStep,
RecordId,
},
protocol::{basics::SecureMul, context::Context, step::BitOpStep, RecordId},
secret_sharing::{replicated::semi_honest::AdditiveShare, WeakSharedValue},
};

Expand All @@ -25,7 +19,7 @@ pub(crate) enum Step {
/// adds y to x, Output has same length as x (carries and indices of y too large for x are ignored)
/// # Errors
/// propagates errors from multiply
#[cfg(all(test, unit_test))]
#[allow(dead_code)]
pub async fn integer_add<C, XS, YS>(
ctx: C,
record_id: RecordId,
Expand Down Expand Up @@ -61,7 +55,7 @@ where
S: CustomArray + Field,
S::Element: Field,
{
use crate::ff::Expand;
use crate::{ff::Expand, protocol::basics::if_else};
let mut carry = AdditiveShare::<S::Element>::ZERO;
let result = addition_circuit(
ctx.narrow(&Step::SaturatedAddition),
Expand Down Expand Up @@ -92,7 +86,7 @@ where
/// for all i: output[i] = x[i] + (c[i-1] + y[i])
/// # Errors
/// propagates errors from multiply
#[cfg(all(test, unit_test))]
#[allow(dead_code)]
async fn addition_circuit<C, XS, YS>(
ctx: C,
record_id: RecordId,
Expand Down Expand Up @@ -131,7 +125,6 @@ where
/// update carry to carry = ( x + carry)(y + carry) + carry
/// # Errors
/// propagates errors from multiply
#[cfg(all(test, unit_test))]
async fn bit_adder<C, S>(
ctx: C,
record_id: RecordId,
Expand Down
6 changes: 1 addition & 5 deletions src/protocol/ipa_prf/boolean_ops/share_conversion_aby.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#[cfg(all(test, unit_test))]
use std::ops::Neg;

#[cfg(all(test, unit_test))]
use ipa_macros::Step;

#[cfg(all(test, unit_test))]
use crate::{
error::Error,
ff::{
Expand All @@ -22,7 +19,6 @@ use crate::{
},
};

#[cfg(all(test, unit_test))]
#[derive(Step)]
pub(crate) enum Step {
GenerateSecretSharing,
Expand Down Expand Up @@ -96,7 +92,7 @@ pub(crate) enum Step {
///
/// # Errors
/// Propagates Errors from Integer Subtraction and Partial Reveal
#[cfg(all(test, unit_test))]
#[allow(dead_code)]
async fn convert_to_fp25519<C, B>(
ctx: C,
record_id: RecordId,
Expand Down
2 changes: 1 addition & 1 deletion src/protocol/sort/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub(crate) enum SortStep {
}

#[derive(Step, Clone, Copy)]
pub(crate) enum ShuffleStep {
pub enum ShuffleStep {
Shuffle1,
Shuffle2,
Shuffle3,
Expand Down

0 comments on commit 24a2018

Please sign in to comment.