Skip to content

Commit

Permalink
Fix DPF PRG key num
Browse files Browse the repository at this point in the history
  • Loading branch information
myl7 committed Jan 28, 2024
1 parent 09512e5 commit c557cb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/dpf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,8 @@ mod tests {
use crate::group::byte::ByteGroup;
use crate::prg::Aes256HirosePrg;

const KEYS: &[&[u8; 32]] = &[
b"j9\x1b_\xb3X\xf33\xacW\x15\x1b\x0812K\xb3I\xb9\x90r\x1cN\xb5\xee9W\xd3\xbb@\xc6d",
b"\x9b\x15\xc8\x0f\xb7\xbc!q\x9e\x89\xb8\xf7\x0e\xa0S\x9dN\xfa\x0c;\x16\xe4\x98\x82b\xfcdy\xb5\x8c{\xc2",
];
const KEYS: &[&[u8; 32]] =
&[b"j9\x1b_\xb3X\xf33\xacW\x15\x1b\x0812K\xb3I\xb9\x90r\x1cN\xb5\xee9W\xd3\xbb@\xc6d"];
const ALPHAS: &[&[u8; 16]] = &[
b"K\xa9W\xf5\xdd\x05\xe9\xfc?\x04\xf6\xfbUo\xa8C",
b"\xc2GK\xda\xc6\xbb\x99\x98Fq\"f\xb7\x8csU",
Expand Down
4 changes: 4 additions & 0 deletions src/prg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pub struct Aes128MatyasMeyerOseasPrg {
}

impl Aes128MatyasMeyerOseasPrg {
/// `keys` length MUST be the output size divided by 16.
/// Otherwise the runtime size check would fail and panic.
pub fn new(keys: &[&[u8; 16]]) -> Self {
Self {
ciphers: keys
Expand Down Expand Up @@ -70,6 +72,8 @@ pub struct Aes256HirosePrg {
}

impl Aes256HirosePrg {
/// `keys` length MUST be the output size divided by 32.
/// Otherwise the runtime size check would fail and panic.
pub fn new(keys: &[&[u8; 32]]) -> Self {
Self {
ciphers: keys
Expand Down

0 comments on commit c557cb3

Please sign in to comment.