-
Notifications
You must be signed in to change notification settings - Fork 578
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
Refactor: Kyber internals #3887
Conversation
a5d3284
to
2356f56
Compare
Force-pushed after #3888, to fix CI. |
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.
I really like Kyber with strong types! Also, the buffer stuffer fits very well. No more nasty pointer arithmetic 🎉
95143b8
to
3fc1233
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.
Nice! I have the code on my left and the FIPS 203 spec on my right screen, and can easily compare it 👍
56b1741
to
c5a5396
Compare
c5a5396
to
dc661f6
Compare
dc661f6
to
d523931
Compare
Rebased and resolved conflicts after #3874 got merged. |
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.
Very nice 👍
Thanks for the review! We have a further iteration for this in the pipeline, though. It'll be a few weeks before we're done with it, unfortunately. Currently busy preparing the concluding workshop for BSI's project 481. |
Resolved a conflict with master. |
* BufferStuff/Slicer * Strong types * Prepare for introduction of ML-KEM (ipd) * introduce nomenclature of FIPS 203
I realized that the planned changes, I mentioned last month, can be easily added on top of this. So, let's merge this now and we'll continue working on master. |
See: randombit/botan#3887 This is a fairly minimal adaption, once the full refactoring is merged, we'll have to rewrite this more substantially. That won't happen before Botan 3.5.0, though. See also: randombit/botan#4024
This is an iteration of the Kyber internals, in preparation of an ML-KEM implementation. Also, it retrofits the helpers we added along the way in the last two years. Most notably:
BufferStuffer
andBufferSlicer
andStrong<>
types. Especially the strong types made it possible to restrict the "symmetric algorithms" inkyber_symmetric_primitives.h
.Before, most of the algorithm (i.e. the Polynomial structures) was hidden away in the
kyber.cpp
compilation unit in thekyber_common
module. For added flexibility, I restructured the code into a few distinct header and implementation files. Also, thekyber
andkyber_90s
modules now moved inside a new internalkyber_round3
module. These changes make room for an upcoming ML-KEM-ipd implementation that reuses as much of the implementation as possible.The public interface isn't affected by any of those changes.