Skip to content

Commit

Permalink
change ipa:: to ipa_core::
Browse files Browse the repository at this point in the history
  • Loading branch information
taikiy committed Nov 24, 2023
1 parent 7ae8b8c commit fd30724
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 23 deletions.
3 changes: 1 addition & 2 deletions ipa-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "ipa"
name = "ipa-core"
version = "0.1.0"
rust-version = "1.64.0"
edition = "2021"
Expand Down Expand Up @@ -160,7 +160,6 @@ rustls = { version = "0.21", features = ["dangerous_configuration"] }
tempfile = "3"

[lib]
name = "ipa"
path = "src/lib.rs"
bench = false

Expand Down
2 changes: 1 addition & 1 deletion ipa-core/benches/ct/arithmetic_circuit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use criterion::{
black_box, criterion_group, criterion_main, BenchmarkId, Criterion, SamplingMode, Throughput,
};
use ipa::{ff::Fp31, test_fixture::circuit};
use ipa_core::{ff::Fp31, test_fixture::circuit};
use tokio::runtime::Builder;

pub fn criterion_benchmark(c: &mut Criterion) {
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/benches/iai/arithmetic_circuit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use iai::black_box;
use ipa::{ff::Fp31, test_fixture::circuit};
use ipa_core::{ff::Fp31, test_fixture::circuit};
use tokio::runtime::Builder;

pub fn iai_benchmark() {
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/benches/oneshot/arithmetic_circuit.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Instant;

use clap::Parser;
use ipa::{ff::Fp31, secret_sharing::SharedValue, test_fixture::circuit};
use ipa_core::{ff::Fp31, secret_sharing::SharedValue, test_fixture::circuit};

#[derive(Debug, Parser)]
pub struct CircuitArgs {
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/benches/oneshot/ipa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{
};

use clap::Parser;
use ipa::{
use ipa_core::{
error::Error,
ff::Fp32BitPrime,
helpers::{query::IpaQueryConfig, GatewayConfig},
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/benches/oneshot/sort.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::time::Instant;

use futures::stream::iter as stream_iter;
use ipa::{
use ipa_core::{
error::Error,
ff::{Field, Fp32BitPrime, GaloisField},
helpers::GatewayConfig,
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/src/bin/helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::{

use clap::{self, Parser, Subcommand};
use hyper::http::uri::Scheme;
use ipa::{
use ipa_core::{
cli::{
client_config_setup, keygen, test_setup, ConfGenArgs, KeygenArgs, TestSetupArgs, Verbosity,
},
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/src/bin/ipa_bench/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{
};

use clap::Parser;
use ipa::cli::Verbosity;
use ipa_core::cli::Verbosity;
use rand::{rngs::StdRng, SeedableRng};
use tracing::{debug, error, info};

Expand Down
2 changes: 1 addition & 1 deletion ipa-core/src/bin/report_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{
use clap::{Parser, Subcommand};
use comfy_table::{Cell, Table};
use hyper::http::uri::Scheme;
use ipa::{
use ipa_core::{
cli::{
noise::{apply, ApplyDpArgs},
playbook::{make_clients, playbook_ipa, playbook_oprf_ipa, validate, InputSource},
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/src/bin/test_mpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{error::Error, fmt::Debug, ops::Add, path::PathBuf};
use clap::{Parser, Subcommand};
use generic_array::ArrayLength;
use hyper::http::uri::Scheme;
use ipa::{
use ipa_core::{
cli::{
playbook::{make_clients, secure_mul, validate, InputSource},
Verbosity,
Expand Down
12 changes: 6 additions & 6 deletions ipa-core/src/protocol/context/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ use crate::{
/// record ID and the other can use something like a `BitOpStep`.
///
/// ```no_run
/// use ipa::protocol::{context::{UpgradeContext, UpgradeToMalicious, UpgradedMaliciousContext as C}, NoRecord, RecordId};
/// use ipa::ff::Fp32BitPrime as F;
/// use ipa::secret_sharing::replicated::{
/// use ipa_core::protocol::{context::{UpgradeContext, UpgradeToMalicious, UpgradedMaliciousContext as C}, NoRecord, RecordId};
/// use ipa_core::ff::Fp32BitPrime as F;
/// use ipa_core::secret_sharing::replicated::{
/// malicious::AdditiveShare as MaliciousReplicated, semi_honest::AdditiveShare as Replicated,
/// };
/// // Note: Unbound upgrades only work when testing.
Expand All @@ -45,9 +45,9 @@ use crate::{
/// ```
///
/// ```compile_fail
/// use ipa::protocol::{context::{UpgradeContext, UpgradeToMalicious, UpgradedMaliciousContext as C}, NoRecord, RecordId};
/// use ipa::ff::Fp32BitPrime as F;
/// use ipa::secret_sharing::replicated::{
/// use ipa_core::protocol::{context::{UpgradeContext, UpgradeToMalicious, UpgradedMaliciousContext as C}, NoRecord, RecordId};
/// use ipa_core::ff::Fp32BitPrime as F;
/// use ipa_core::secret_sharing::replicated::{
/// malicious::AdditiveShare as MaliciousReplicated, semi_honest::AdditiveShare as Replicated,
/// };
/// // This can't be upgraded with a record-bound context because the record ID
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/src/protocol/sort/generate_permutation_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ mod tests {

/// Passing 32 records for Fp31 doesn't work.
#[tokio::test]
#[should_panic = "prime field ipa::ff::prime_field::fp31::Fp31 is too small to sort 32 records"]
#[should_panic = "prime field ipa_core::ff::prime_field::fp31::Fp31 is too small to sort 32 records"]
async fn fp31_overflow() {
const COUNT: usize = 32;
const NUM_MULTI_BITS: u32 = 3;
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::{
};

use command_fds::CommandFdExt;
use ipa::{
use ipa_core::{
cli::IpaQueryResult, helpers::query::IpaQueryConfig, test_fixture::ipa::IpaSecurityModel,
};
use rand::thread_rng;
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/tests/compact_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mod common;
use std::num::NonZeroU32;

use common::test_ipa_with_config;
use ipa::{helpers::query::IpaQueryConfig, test_fixture::ipa::IpaSecurityModel};
use ipa_core::{helpers::query::IpaQueryConfig, test_fixture::ipa::IpaSecurityModel};

fn test_compact_gate<I: TryInto<NonZeroU32>>(
mode: IpaSecurityModel,
Expand Down
2 changes: 1 addition & 1 deletion ipa-core/tests/helper_networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use common::{
spawn_helpers, tempdir::TempDir, test_ipa, test_multiply, test_network, CommandExt,
UnwrapStatusExt, HELPER_BIN,
};
use ipa::{cli::CliPaths, helpers::HelperIdentity, test_fixture::ipa::IpaSecurityModel};
use ipa_core::{cli::CliPaths, helpers::HelperIdentity, test_fixture::ipa::IpaSecurityModel};

#[test]
#[cfg(all(test, web_test))]
Expand Down
4 changes: 2 additions & 2 deletions pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ check "Tests" \
cargo test

check "Web tests" \
cargo test --no-default-features --features "cli web-app real-world-infra test-fixture descriptive-gate"
cargo test -p ipa-core --no-default-features --features "cli web-app real-world-infra test-fixture descriptive-gate"

check "Concurrency tests" \
cargo test --release --features shuttle
cargo test -p ipa-core --release --features shuttle

check "IPA benchmark" \
cargo bench --bench oneshot_ipa --no-default-features --features="enable-benches descriptive-gate" -- -n 62
Expand Down

0 comments on commit fd30724

Please sign in to comment.