-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More kyber code refactoring #135
Conversation
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.
Please describe what this PR is doing.
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.
Thanks. Generally looks like good cleanup.
Let's add comments to things you're touching to get comments back in here.
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.
Thanks, only one nit.
Let's make sure to get laxing on CI before merging this. But otherwise this is good to go.
e6e3ef6
to
ea870ce
Compare
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.
All looks good, thanks.
ea870ce
to
e96433b
Compare
e96433b
to
7bbb472
Compare
40c2915
to
be406dd
Compare
This PR is a grab-bag of various changes to Kyber to make things clearer, fix constant time issues and such:
ntt.rs
had code for both the NTT and functions that used the NTT in matrix/vector multiplication. These latter functions have been moved to amatrix.rs
file.KyberPolynomialRingElement
andKyberFieldElement
to justPolynomialRingElement
andFieldElement
(they're in the Kyber code, so the Kyber prefix is uncessary)R^{-1}
, others have been multiplied byR
, so multiplications take elements from the montgomery domain to the standard domain, some the other way around, so I added some type aliases and corresponding functions to try and document this. These type aliases could become tuple structs latercbd
function inind_cpa.rs
tosample_vector_cbd_then_ntt
and expanded its use.at_layer
macros used in the NTT have been converted to functions that get inlined