Skip to content

Commit

Permalink
Another rename.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvzcf committed May 24, 2024
1 parent 31d95d1 commit a98865a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libcrux-ml-dsa/src/matrix.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::{arithmetic::PolynomialRingElement, sample::sample_ring_element_for_A};
use crate::{arithmetic::PolynomialRingElement, sample::sample_ring_element_uniform};

#[allow(non_snake_case)]
#[inline(always)]
Expand All @@ -13,7 +13,7 @@ pub(crate) fn expand_to_A<const ROWS_IN_A: usize, const COLUMNS_IN_A: usize>(
seed[32] = i as u8;
seed[33] = j as u8;

let sampled = sample_ring_element_for_A(seed);
let sampled = sample_ring_element_uniform(seed);

if transposed {
A[j][i] = sampled;
Expand Down
6 changes: 3 additions & 3 deletions libcrux-ml-dsa/src/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn sample_from_uniform_distribution_next(
}

#[allow(non_snake_case)]
pub(crate) fn sample_ring_element_for_A(seed: [u8; 34]) -> PolynomialRingElement {
pub(crate) fn sample_ring_element_uniform(seed: [u8; 34]) -> PolynomialRingElement {
let mut state = XOF::new(seed);
let randomness = XOF::squeeze_first_five_blocks(&mut state);

Expand All @@ -51,7 +51,7 @@ mod tests {

#[allow(non_snake_case)]
#[test]
fn test_sample_ring_element_for_A() {
fn test_sample_ring_element_uniform() {
let seed: [u8; 34] = [
33, 192, 250, 216, 117, 61, 16, 12, 248, 51, 213, 110, 64, 57, 119, 80, 164, 83, 73,
91, 80, 128, 195, 219, 203, 149, 170, 233, 16, 232, 209, 105, 4, 5,
Expand Down Expand Up @@ -88,7 +88,7 @@ mod tests {
];

assert_eq!(
sample_ring_element_for_A(seed).coefficients,
sample_ring_element_uniform(seed).coefficients,
expected_coefficients
);
}
Expand Down

0 comments on commit a98865a

Please sign in to comment.