Skip to content

Commit

Permalink
Add redirection for inefficient prg
Browse files Browse the repository at this point in the history
  • Loading branch information
myl7 committed Jan 30, 2024
1 parent fa7c3d2 commit 39a4d4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ pub(crate) use decl_prg_trait;
///
/// Requires `Sync` for multi-threading, which should be still easy for even single-threaded
///
/// NOTICE: The trait with the impls still has performance issues
/// NOTICE: The trait with the impls still has performance issues,
/// Use [`crate::dpf::prg`] or [`crate::dcf::prg`] instead.
pub trait PrgBytes: Sync {
fn gen(&self, buf: &mut [u8], src: &[u8]);
}
Expand Down
6 changes: 4 additions & 2 deletions src/prg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ use crate::PrgBytes;

/// Pseudorandom generator that generates bytes with AES128, the Matyas-Meyer-Oseas single-block-length one-way compression function, and precreated keys
///
/// NOTICE: The impl still has performance issues
/// NOTICE: The impl still has performance issues.
/// Use [`crate::dpf::prg`] or [`crate::dcf::prg`] instead.
pub struct Aes128MatyasMeyerOseasPrgBytes {
ciphers: Vec<Aes128MatyasMeyerOseasCipher>,
}
Expand Down Expand Up @@ -70,7 +71,8 @@ impl MatyasMeyerOseas<16> for Aes128MatyasMeyerOseasCipher {

/// Pseudorandom generator that generates bytes with AES256, the Hirose double-block-length one-way compression function, and precreated keys
///
/// NOTICE: The impl still has performance issues
/// NOTICE: The impl still has performance issues.
/// Use [`crate::dpf::prg`] or [`crate::dcf::prg`] instead.
pub struct Aes256HirosePrgBytes {
ciphers: Vec<Aes256HiroseCipher>,
}
Expand Down

0 comments on commit 39a4d4c

Please sign in to comment.