-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed "/KYBER_Q" in poly_compress and polyvec_compress; thanks to P…
…rasanna Ravi and Matthias Kannwischer for pointing out that a DIV instruction could turn into a plaintext-checking oracle
- Loading branch information
1 parent
dda29cc
commit 272125f
Showing
5 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
272125f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have some instances of
KYBER_Q/2
been replaced with 1664, and others 1665? Isn't the correct value 1664? Perhaps I don't understand the barrett reduction properly.(edit: ok I tested it against my own version and the numbers all match, so I guess I'm indeed not understanding the specifics of the barrett reduction)
272125f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is due to rounding. The reductions are exhaustively tested to produce the correct output for all inputs.
272125f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In the poly_compress and polyvec_compress functions, different multiplication factors (such as 80635, 40318, 645084, and 1290167) are used. Why are these factors different, and how were they computed? Additionally, in the poly_tomsg function, the line t += ((int16_t)t >> 15) & KYBER_Q is commented out, while it remains active in the poly_compress and polyvec_compress functions. Why was this change made in poly_tomsg?"