This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a reference implementation for the ML-KEM NIST standard, located @ https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.pdf. | |
| # It's definitely not secure to timing attacks, and almost certainly not secure in other ways too. DO NOT USE THIS IN PRODUCTION. | |
| # It's not very performant. Even in Python, it could be written significantly faster. | |
| # My goal with this implementation was just to try to get the math correct, as simply as possible in Python, | |
| # by matching the specification above line by line. Understanding this code is much easier with the above spec open. | |
| import secrets | |
| import hashlib |