https://github.com/mahadmuhammad/fips204
https://github.com/mahadmuhammad/fips204
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mahadmuhammad/fips204
- Owner: MahadMuhammad
- Created: 2024-11-20T19:08:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-08T20:17:00.000Z (over 1 year ago)
- Last Synced: 2025-02-12T12:57:00.154Z (over 1 year ago)
- Language: Python
- Homepage: https://csrc.nist.gov/pubs/fips/204/final
- Size: 49.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
> [!NOTE]
> The code here is copied and modified from: https://github.com/GiacomoPope/dilithium-py
>
> I studied this code, as a part of my information security course.
>
> See, official Dilithium implementation: https://github.com/pq-crystals/dilithium
#### Example
```python
>>> from dilithium_py.ml_dsa import ML_DSA_44
>>>
>>> # Example of signing
>>> pk, sk = ML_DSA_44.keygen()
>>> msg = b"Your message signed by ML_DSA"
>>> sig = ML_DSA_44.sign(sk, msg)
>>> assert ML_DSA_44.verify(pk, msg, sig)
>>>
>>> # Verification will fail with the wrong msg or pk
>>> assert not ML_DSA_44.verify(pk, b"", sig)
>>> pk_new, sk_new = ML_DSA_44.keygen()
>>> assert not ML_DSA_44.verify(pk_new, msg, sig)
```
The above example would also work with the other NIST levels `ML_DSA_65` and `ML_DSA_87`.