Skip to content

Commit

Permalink
Move AES PRNG to separate crate (#1082)
Browse files Browse the repository at this point in the history
* move AES PRNG to separate crate

* Update to `aes-prng` 0.2
  • Loading branch information
mortendahl authored May 30, 2022
1 parent 248f422 commit c4ce50d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 433 deletions.
5 changes: 1 addition & 4 deletions moose/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ async_execute = []

[dependencies]
aes = "~0.8"
aes-prng = "~0.2"
anyhow = "~1.0"
async_cell = "~0.2"
async-trait = "~0.1"
Expand Down Expand Up @@ -61,10 +62,6 @@ rand_chacha = "~0.3"
rstest = "~0.12"
tempfile = "~3.3"

[[bench]]
name = "rng"
harness = false

[[bench]]
name = "exec"
harness = false
Expand Down
94 changes: 0 additions & 94 deletions moose/benches/rng.rs

This file was deleted.

2 changes: 1 addition & 1 deletion moose/src/host/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use super::*;
use crate::error::{Error, Result};
use crate::execution::{RuntimeSession, Session};
use crate::host::bitarray::BitArrayRepr;
use crate::prng::AesRng;
use crate::{Const, Ring, N128, N224, N64};
use aes_prng::AesRng;
use bitvec::prelude::BitVec;
use ndarray::LinalgScalar;
use ndarray::Zip;
Expand Down
5 changes: 2 additions & 3 deletions moose/src/host/prim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use super::HostPlacement;
use crate::computation::{DeriveSeedOp, Placed, PrfKeyGenOp, TAG_BYTES};
use crate::execution::{RuntimeSession, Session};
use crate::kernels::PlacementPlace;
use crate::prng::AesRng;
use crate::prng::{RngSeed, SEED_SIZE};
use aes_prng::{AesRng, RngSeed, SEED_SIZE};
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;

Expand Down Expand Up @@ -116,7 +115,7 @@ impl PrfKeyGenOp {
_sess: &S,
plc: &HostPlacement,
) -> crate::error::Result<HostPrfKey> {
let raw_key = RawPrfKey(AesRng::generate_random_key());
let raw_key = RawPrfKey(AesRng::generate_random_seed());
Ok(HostPrfKey(raw_key, plc.clone()))
}
}
Expand Down
1 change: 0 additions & 1 deletion moose/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2788,7 +2788,6 @@ pub mod logical;
pub mod mirrored;
pub mod networking;
pub mod prelude;
pub mod prng;
pub mod replicated;
pub mod storage;
pub mod textual;
Expand Down
Loading

0 comments on commit c4ce50d

Please sign in to comment.