Skip to content

Conversation

@AdityaMitra5102
Copy link

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,

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
@CLAassistant
Copy link

CLAassistant commented Jul 17, 2025

CLA assistant check
All committers have signed the CLA.

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.
Copy link
Collaborator

@MasterKale MasterKale left a 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.

class ML_DSAPublicKey:
def __init__(self, alg, pub) -> None:
if not isML_DSA_available():
raise Exception("OQS Not installed")
Copy link
Collaborator

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.

@AdityaMitra5102
Copy link
Author

AdityaMitra5102 commented Sep 5, 2025

Hi,
Thanks a lot for the review. And yes, oqs is an optional dependency. Users can just install py_webauthn and use it without oqs. Later when they install liboqs-python, this package will automatically detect it and use it (unless there is some version mismatch with the C bindings, in which case OQS will warn and this package will fall back to not using OQS.)

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.

@MasterKale
Copy link
Collaborator

Hello @AdityaMitra5102 apologies for the suddenness of this but I've superseded this PR with #260 that uses Dilithium-py instead.

@MasterKale MasterKale closed this Sep 29, 2025
@AdityaMitra5102
Copy link
Author

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.)

https://github.com/AdityaMitra5102/ML-DSA-PurePy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants