-
Notifications
You must be signed in to change notification settings - Fork 54
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
separate the sources into dedicated directory, fix doc generation #47
Conversation
Thanks for doing this work. The only thing I'm not sure about is calling the package "kyber" but I don't have a great idea about what to do. It's annoying to have to think about the future here as Kyber will be an antiquated name at some point. Maybe mlkem_py, ml_kem_py, py_mlkem or even kyber_py... can't decide and I'm not super happy with any of them |
Also I think I prefer the absolute rather than relative paths to functions but if relative is the standard then I guess I can accept this. |
I still see plenty of code that refers to AES as Rijndael... 🙂 and kyber definitely rolls of the tongue better than ML-KEM, unlike Rijndael vs AES... The thing is, that the package name in PyPI is |
Yeah ok let's do kyber_py for the package name. I don't think that we should "package" this properly until the final spec is out but it doesn't hurt to pick a name now. |
Well, I'd prefer it as a package for integrating into tlslite-ng... |
Sure I appreciate that. Originally I was very against this being an importable package as I wanted to dissuade people from using it for cryptography but let's see what state the code is in after a little more work. |
d551c79
to
628dcad
Compare
Thanks for changing the name. Could we also tweak the examples in the README so the imports are correct for users? >>> from ml_kem import ML_KEM128
>>> ek, dk = ML_KEM128.keygen()
>>> key, ct = ML_KEM128.encaps(ek)
>>> _key = ML_KEM128.decaps(ct, dk)
>>> assert key == _key to something like: >>> from kyber_py.ml_kem import ML_KEM128
>>> ek, dk = ML_KEM128.keygen()
>>> key, ct = ML_KEM128.encaps(ek)
>>> _key = ML_KEM128.decaps(ct, dk)
>>> assert key == _key |
for the documentation generation to work, the code needs to work as a package, and the package needs to have a valid name (kyber-py won't work), so put all of the sources into the src/kyber directory. Upside: clear separation between shipping code and tests. Also, because everything is in single module, it won't pollute python namespace Signed-off-by: Hubert Kario <[email protected]> # Conflicts: # src/kyber_py/kyber/kyber.py # src/kyber_py/ml_kem/ml_kem.py
6683069
to
28fcce4
Compare
Signed-off-by: Hubert Kario <[email protected]>
@GiacomoPope also docs needed fixing, I've added them to CI now so it will be clear if/when they get broken again :) |
for the documentation generation to work, the code needs to work as a package and be importable, and the package needs to have a valid name (
kyber-py
won't work), so put all of the sources into thesrc/kyber
directory. Upside: clear separation between shipping code and tests. Also, because everything is in single module, it won't pollute python namespace.also change it to use relative imports so that any future refactoring is easier (and they're recommended anyway)