{
  "id": "2024/1880",
  "url": "https://opencryptology.org/2024/1880",
  "original_url": "https://eprint.iacr.org/2024/1880",
  "title": "Cryptography Experiments In Lean 4: SHA-3 Implementation",
  "authors": [
    "Gérald Doussot"
  ],
  "affiliations": null,
  "abstract": "In this paper we explain how we implemented the Secure Hash Algorithm-3 (SHA-3) family of functions in Lean 4, a functional programming language and theorem prover. We describe how we used several Lean facilities including type classes, dependent types, macros, and formal verification, and then refined the design to provide a simple one-shot and streaming API for hashing, and Extendable-output functions (XOFs), to reduce potential for misuse by users, and formally prove properties about the implementation.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Cryptography Experiments In Lean 4: SHA-3 Implementation” by Gérald Doussot, Cryptology ePrint Archive, Paper 2024/1880, https://eprint.iacr.org/2024/1880. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2024-11-19T02:27:07Z",
    "updated": "2024-11-19T02:27:07Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2024/1880.pdf",
    "sha256": "64118c081b480dfe04658466b1d3af456f1b20fc9e5ea2580d075fdce124796d",
    "size": 177966,
    "source": "github-mirror",
    "source_date": "2026-04-28T17:20:00Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "eprint_size": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2024/1880/versions/20260428T172000Z.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "label": "copy captured 2026-04-28",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/1880.pdf",
      "size": 177966,
      "sha256": "64118c081b480dfe04658466b1d3af456f1b20fc9e5ea2580d075fdce124796d",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2024/1880.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 177966
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260228143323id_/https://eprint.iacr.org/2024/1880.pdf",
      "captured_at": "2026-02-28T14:33:23Z",
      "size": 178866
    }
  ],
  "bibtex": "@misc{cryptoeprint:2024/1880,\n      author = {Gérald Doussot},\n      title = {Cryptography Experiments In Lean 4: SHA-3 Implementation},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2024/1880},\n      year = {2024},\n      url = {https://eprint.iacr.org/2024/1880}\n}"
}
