Skip to content

Commit

Permalink
Merge pull request Argyle-Software#78 from bwesterb/patch-2
Browse files Browse the repository at this point in the history
Fix: incorrectly named function poly_frommont -> poly_tomont
  • Loading branch information
mberry authored Apr 12, 2023
2 parents 1b1637c + f2e63c9 commit 06d920f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/reference/indcpa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub fn indcpa_keypair<R>(
// matrix-vector multiplication
for i in 0..KYBER_K {
polyvec_basemul_acc_montgomery(&mut pkpv.vec[i], &a[i], &skpv);
poly_frommont(&mut pkpv.vec[i]);
poly_tomont(&mut pkpv.vec[i]);
}
polyvec_add(&mut pkpv, &e);
polyvec_reduce(&mut pkpv);
Expand Down
6 changes: 3 additions & 3 deletions src/reference/poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,13 @@ pub fn poly_basemul(r: &mut Poly, a: &Poly, b: &Poly)
}
}

// Name: poly_frommont
// Name: poly_tomont
//
// Description: Inplace conversion of all coefficients of a polynomial
// from Montgomery domain to normal domain
// from normal domain to Montgomery domain
//
// Arguments: - poly *r: input/output polynomial
pub fn poly_frommont(r: &mut Poly)
pub fn poly_tomont(r: &mut Poly)
{
let f = ((1u64 << 32) % KYBER_Q as u64) as i16;
for i in 0..KYBER_N {
Expand Down

0 comments on commit 06d920f

Please sign in to comment.