{
  "id": "2023/522",
  "url": "https://opencryptology.org/2023/522",
  "original_url": "https://eprint.iacr.org/2023/522",
  "title": "SAFE: Sponge API for Field Elements",
  "authors": [
    "JP Aumasson",
    "Dmitry Khovratovich",
    "Bart Mennink",
    "Porçu Quine"
  ],
  "affiliations": null,
  "abstract": "From hashing and commitment schemes to Fiat-Shamir and encryption,\nhash functions are everywhere in zero-knowledge proofsystems (ZKPs), and minor performance changes in ``vanilla'' implementations can translate in major discrepancies when the hash is processed as a circuit within the proofsystem.\n\nProtocol designers have resorted to a number of techniques and custom\nmodes to optimize hash functions for ZKPs settings, but so far without a single established, well-studied construction. To address this need, we define the Sponge API for Field Elements (SAFE), a unified framework for permutation-based schemes (including AEAD, Sigma, PRNGs, and so on).  SAFE eliminates the performance overhead, is pluggable in any field-oriented protocol, and is suitable for any permutation algorithm.\n\nSAFE is implemented in Filecoin's Neptune hash framework, {which is} our reference implementation (in Rust). SAFE is also being integrated in other prominent ZKP projects. This report specifies SAFE and describes some use cases.\n\nAmong other improvements, our construction is  among the first to store\nthe protocol metadata in the sponge inner part in a provably secure\nway, which may be of independent interest to the sponge use cases outside of ZKP.",
  "category": "Implementation",
  "license": {
    "code": "CC0",
    "url": "https://creativecommons.org/publicdomain/zero/1.0/",
    "label": "CC0 1.0",
    "attribution": "“SAFE: Sponge API for Field Elements” by JP Aumasson, Dmitry Khovratovich, Bart Mennink, Porçu Quine, Cryptology ePrint Archive, Paper 2023/522, https://eprint.iacr.org/2023/522. Licensed under CC0 1.0 (https://creativecommons.org/publicdomain/zero/1.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2023-04-11T14:44:04Z",
    "updated": "2023-04-11T14:44:04Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2023/522.pdf",
    "sha256": "50eed60c2f7bc210ab6e0a2e1c24a4ee21b85fab2809b501c09550b0c0d731eb",
    "size": 359226,
    "source": "github-mirror",
    "source_date": "2024-01-14T06:13:41Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2023/522/versions/20240114T061341Z.pdf",
      "captured_at": "2024-01-14T06:13:41Z",
      "label": "copy captured 2024-01-14",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2023/522.pdf",
      "size": 359226,
      "sha256": "50eed60c2f7bc210ab6e0a2e1c24a4ee21b85fab2809b501c09550b0c0d731eb",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20250629154003id_/https://eprint.iacr.org/2023/522.pdf",
      "captured_at": "2025-06-29T15:40:03Z",
      "size": 344664
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2023/522.pdf",
      "captured_at": "2024-01-14T06:13:41Z",
      "size": 359226
    }
  ],
  "bibtex": "@misc{cryptoeprint:2023/522,\n      author = {JP Aumasson and Dmitry Khovratovich and Bart Mennink and Porçu Quine},\n      title = {SAFE: Sponge API for Field Elements},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2023/522},\n      year = {2023},\n      url = {https://eprint.iacr.org/2023/522}\n}"
}
