Skip to content

Commit

Permalink
Move cpa and dpa to distinguishers module
Browse files Browse the repository at this point in the history
  • Loading branch information
TrAyZeN committed Jul 31, 2024
1 parent 7f4e72c commit 59d923a
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions benches/cpa.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use muscat::cpa::{self, Cpa, CpaProcessor};
use muscat::cpa_normal;
use muscat::distinguishers::cpa::{self, Cpa, CpaProcessor};
use muscat::distinguishers::cpa_normal;
use muscat::leakage::{hw, sbox};
use ndarray::{Array2, ArrayView1, Axis};
use ndarray_rand::rand::{rngs::StdRng, SeedableRng};
Expand Down
2 changes: 1 addition & 1 deletion benches/dpa.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use muscat::dpa::{dpa, Dpa, DpaProcessor};
use muscat::distinguishers::dpa::{dpa, Dpa, DpaProcessor};
use muscat::leakage::sbox;
use ndarray::{Array1, Array2};
use ndarray_rand::rand::{rngs::StdRng, SeedableRng};
Expand Down
2 changes: 1 addition & 1 deletion examples/cpa.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use indicatif::ProgressIterator;
use muscat::cpa_normal::CpaProcessor;
use muscat::distinguishers::cpa_normal::CpaProcessor;
use muscat::leakage::{hw, sbox};
use muscat::util::{progress_bar, read_array2_from_npy_file, save_array2};
use ndarray::*;
Expand Down
2 changes: 1 addition & 1 deletion examples/cpa_partioned.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use indicatif::ProgressIterator;
use muscat::cpa::CpaProcessor;
use muscat::distinguishers::cpa::CpaProcessor;
use muscat::leakage::{hw, sbox};
use muscat::util::{progress_bar, read_array2_from_npy_file, save_array};
use rayon::prelude::{ParallelBridge, ParallelIterator};
Expand Down
2 changes: 1 addition & 1 deletion examples/dpa.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use indicatif::ProgressIterator;
use muscat::dpa::DpaProcessor;
use muscat::distinguishers::dpa::DpaProcessor;
use muscat::leakage::sbox;
use muscat::util::read_array2_from_npy_file;
use ndarray::{s, Array1};
Expand Down
2 changes: 1 addition & 1 deletion examples/rank.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use anyhow::Result;
use indicatif::ProgressIterator;
use muscat::cpa::CpaProcessor;
use muscat::distinguishers::cpa::CpaProcessor;
use muscat::leakage::{hw, sbox};
use muscat::util::{progress_bar, read_array2_from_npy_file, save_array};
use ndarray::s;
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cpa_normal.rs → src/distinguishers/cpa_normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ndarray::{Array1, Array2, ArrayView1, ArrayView2, Axis};
use rayon::iter::{ParallelBridge, ParallelIterator};
use std::{iter::zip, ops::Add};

use crate::cpa::Cpa;
use crate::distinguishers::cpa::Cpa;

/// Compute the [`Cpa`] of the given traces using [`CpaProcessor`].
///
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions src/distinguishers/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pub mod cpa;
pub mod cpa_normal;
pub mod dpa;
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
pub mod cpa;
pub mod cpa_normal;
pub mod dpa;
pub mod distinguishers;
pub mod leakage;
pub mod leakage_detection;
pub mod preprocessors;
Expand Down

0 comments on commit 59d923a

Please sign in to comment.