-
Notifications
You must be signed in to change notification settings - Fork 182
Support for PQC Added with OQS #258
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
Conversation
PQC Support Added with OQS. Followed draft at https://datatracker.ietf.org/doc/draft-ietf-cose-dilithium/ for COSE parameters and https://datatracker.ietf.org/doc/draft-vitap-ml-dsa-webauthn/ for implementation
Verified OQS is installed before running ML-DSA tests
Earlier it would take 5 secs every time if the python library was installed and the C bindings weren't. Add a memoization to prevent that.
MasterKale
left a comment
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.
Hello @AdityaMitra5102 I apologize for the delayed review. This PR looks pretty good to me, I just had a few suggestions.
I also need to request the addition of some unit tests. It looks like you already have sample PQC responses as per the additions to the examples, but I wonder if those couldn't also become new tests added to the relevant files in tests/.
Based on how you try to detect the presence of oqs, does that mean liboqs-python can be considered an optional dependency of this project? I think it'd be great if, for now, py_webauthn users could continue to use the project with a simple pip install webauthn, then let them later opt into PQC use with pip install liboqs-python and then py_webauthn immediately starts using it.
webauthn/helpers/mldsa.py
Outdated
| class ML_DSAPublicKey: | ||
| def __init__(self, alg, pub) -> None: | ||
| if not isML_DSA_available(): | ||
| raise Exception("OQS Not installed") |
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 should raise something new in webauthn.helpers.exceptions instead of a generic exception.
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
Co-authored-by: Matthew Miller <[email protected]>
|
Hi, I have accepted the code changes and have added the unit tests. I have also confirmed that all unit tests are running, both with and without OQS being installed. |
|
Hello @AdityaMitra5102 apologies for the suddenness of this but I've superseded this PR with #260 that uses Dilithium-py instead. |
|
A yes. Even I thought of using Dilithium-py at the beginning but the way the author warned about the possibilities of side channel attack, that stopped me. Tbh in my own resource constrained environments, including in stuff like circuit-python where normal libraries dont run, and even dilithium-py failed because the circuit python hashlib didnt support shake3, I ported a custom version of dilithium-py. I replaced the aes from cryptography with pyaes and hashlib for sha3 and shake with py-keccak. You might want to check it out. It has no dependencies except numpy (which can be replaced with ulab-numpy for resource constrained devices.) |
PQC Support Added with OQS. Followed draft at https://datatracker.ietf.org/doc/draft-ietf-cose-dilithium/ for COSE parameters and my draft https://datatracker.ietf.org/doc/draft-vitap-ml-dsa-webauthn/ for implementation. Tested with real responses with my under-development PQC Supported Key. The same has been added to examples as well.
Note that OQS needs to be installed. If all dependencies are there, the oqs python library automatically tries to compile OQS. If OQS is not present, it falls back to legacy,