{"id":18715853,"url":"https://github.com/davidbuchanan314/ml-kem-stuff","last_synced_at":"2025-11-10T06:30:24.116Z","repository":{"id":213967646,"uuid":"735373597","full_name":"DavidBuchanan314/ml-kem-stuff","owner":"DavidBuchanan314","description":"A toy implementation of ML-KEM, aka Kyber, based on the current FIPS 203 draft","archived":false,"fork":false,"pushed_at":"2024-01-16T07:00:14.000Z","size":66,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T20:48:29.528Z","etag":null,"topics":["cryptography","cryptography-algorithms","key-encapsulation-mechanism","kyber","ml-kem","post-quantum-cryptography","pqc","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DavidBuchanan314.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-24T17:19:31.000Z","updated_at":"2025-01-08T16:14:27.000Z","dependencies_parsed_at":"2024-01-16T09:16:34.335Z","dependency_job_id":null,"html_url":"https://github.com/DavidBuchanan314/ml-kem-stuff","commit_stats":null,"previous_names":["davidbuchanan314/ml-kem-stuff"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fml-kem-stuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fml-kem-stuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fml-kem-stuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DavidBuchanan314%2Fml-kem-stuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DavidBuchanan314","download_url":"https://codeload.github.com/DavidBuchanan314/ml-kem-stuff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239578254,"owners_count":19662380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","cryptography-algorithms","key-encapsulation-mechanism","kyber","ml-kem","post-quantum-cryptography","pqc","python"],"created_at":"2024-11-07T13:10:29.193Z","updated_at":"2025-11-10T06:30:24.085Z","avatar_url":"https://github.com/DavidBuchanan314.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ml-kem-stuff\n\nA toy implementation of ML-KEM, aka Kyber, based on the current [FIPS 203 draft](https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.203.ipd.pdf).\n\nThis implementation is INCOMPLETE and **INSECURE**, the latter being explicitly out of scope. The current status is \"it looks like it works\" - it's able to derive a shared secret, but I have no idea if it's doing it correctly. ~~I'll do some more rigorous testing later.~~ It passes [these test vectors](https://github.com/post-quantum-cryptography/KAT/tree/main/MLKEM) at least.\n\nThis implementation is *NOT* constant-time, currently.\n\nI wrote this to get my head around ML-KEM, and it's honestly a lot simpler than I was expecting. I'd also read [this](https://words.filippo.io/dispatches/kyber-math/) beforehand, which helped a lot. I was particularly surprised by how simple the implementation of the NTT is, given how conceptually mind-bending it is (at least, it is for me).\n\nYou may also be interested in [GiacomoPope/kyber-py](https://github.com/GiacomoPope/kyber-py), which is basically a more polished version of this repo. However, I avoided looking at any other implementations before embarking on my own, because I wanted to challenge myself and make sure I wasn't skipping any details.\n\n## TODO:\n\n- Proper input validation.\n\n- ~~Actually test it against some test vectors.~~ ML-KEM-768 KAT passed!\n\n- ~~Find out if the minor spec bugs I encountered are real and/or already reported.~~ (answer: yes to both!)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fml-kem-stuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidbuchanan314%2Fml-kem-stuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidbuchanan314%2Fml-kem-stuff/lists"}