{"id":21921137,"url":"https://github.com/gdncc/cryptography","last_synced_at":"2025-03-22T10:37:57.646Z","repository":{"id":259125181,"uuid":"876350249","full_name":"gdncc/Cryptography","owner":"gdncc","description":"Lean 4 programming language and theorem prover cryptography experiments","archived":false,"fork":false,"pushed_at":"2025-02-28T02:09:22.000Z","size":4838,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T09:45:23.032Z","etag":null,"topics":["cryptography","keccak","lean4","sha-3"],"latest_commit_sha":null,"homepage":"","language":"Lean","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/gdncc.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":"2024-10-21T20:22:06.000Z","updated_at":"2025-02-28T02:09:26.000Z","dependencies_parsed_at":"2025-02-28T02:43:55.635Z","dependency_job_id":"f1b0105b-3685-4906-b097-bc70dd666062","html_url":"https://github.com/gdncc/Cryptography","commit_stats":null,"previous_names":["gdncc/cryptography"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdncc%2FCryptography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdncc%2FCryptography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdncc%2FCryptography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gdncc%2FCryptography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gdncc","download_url":"https://codeload.github.com/gdncc/Cryptography/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244945594,"owners_count":20536295,"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","keccak","lean4","sha-3"],"created_at":"2024-11-28T20:19:06.067Z","updated_at":"2025-03-22T10:37:57.626Z","avatar_url":"https://github.com/gdncc.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cryptography\nLean 4 programming language and theorem prover cryptography experiments\n\n\u003e [!CAUTION]\n\u003e :warning: **Under no circumstances should this be used for cryptographic\napplications.** :warning:\n\u003e \n\u003e This is an educational resource. The intended use of this project\n\u003e is for learning and experimenting with cryptography using Lean 4.\n\n## SHA-3 Hash Functions\n\nFor now, the repository contains the implementation of four cryptographic hash\nfunctions, SHA3-224, SHA3-256, SHA3-384, and SHA3-512, and two extendable-output\nfunctions (XOFs), SHAKE128 and SHAKE256 of the SHA-3 family of functions in pure\nLean 4. It provides one-shot, and streaming APIs.\n\nThe library makes use of many Lean 4 features, including dependent typing, type\nclasses, and proofs.\n\nFile [example.lean](Cryptography/Hashes/SHA3/example.lean) shows sample usage of\nthe API. Build and run:\n\n`lake build Cryptography.Hashes.SHA3.example \u0026\u0026 ./.lake/build/bin/Cryptography-Hashes-SHA3-example`\n\nThe implementation passes the test vectors from\n[NIST](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/secure-hashing). The\ntest output must be reviewed manually:\n\n`lake build Cryptography.Hashes.SHA3.test \u0026\u0026 ./.lake/build/bin/Cryptography-Hashes-SHA3-test`\n\nSome performance testing code is included. Loops cannot be unrolled for now, if\none cares about proving some code properties, because of an\n[issue](https://github.com/leanprover/lean4/issues/5324) with Lean's elaborator.\n\n`lake build Cryptography.Hashes.SHA3.perftest \u0026\u0026 ./.lake/build/bin/Cryptography-Hashes-SHA3-perftest`\n\nAll array accesses are formally proven to be within bounds. \n\nSee paper [Cryptography Experiments In Lean 4: SHA-3 Implementation](https://eprint.iacr.org/2024/1880).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdncc%2Fcryptography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgdncc%2Fcryptography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgdncc%2Fcryptography/lists"}