{
  "id": "2021/428",
  "url": "https://opencryptology.org/2021/428",
  "original_url": "https://eprint.iacr.org/2021/428",
  "title": "A Coq proof of the correctness of X25519 in TweetNaCl",
  "authors": [
    "Peter Schwabe",
    "Benoît Viguier",
    "Timmy Weerwag",
    "Freek Wiedijk"
  ],
  "affiliations": null,
  "abstract": "We formally prove that the C implementation of the X25519 key-exchange protocol in the TweetNaCl library is correct. We prove both that it correctly implements the protocol from Bernstein's 2006 paper, as standardized in RFC 7748, as well as the absence of undefined behavior like arithmetic overflows and array out-of-bounds errors. We also formally prove, based on the work of Bartzia and Strub, that X25519 is mathematically correct, i.e., that it correctly computes scalar multiplication on the elliptic curve Curve25519.\n\nThe proofs are all computer-verified using the Coq theorem prover. To establish the link between C and Coq we use the Verified Software Toolchain (VST).",
  "category": "Public-key cryptography",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“A Coq proof of the correctness of X25519 in TweetNaCl” by Peter Schwabe, Benoît Viguier, Timmy Weerwag, Freek Wiedijk, Cryptology ePrint Archive, Paper 2021/428, https://eprint.iacr.org/2021/428. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": true,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2021-04-06T07:13:10Z",
    "updated": "2021-04-06T07:13:10Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2021/428.pdf",
    "sha256": "7a7b5cb1d32829c299eb55ae8c3270fc8f29d97bb032d64e7dc068da0d259283",
    "size": 442639,
    "source": "github-mirror",
    "source_date": "2024-01-14T06:13:28Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2021/428/versions/20240114T061328Z.pdf",
      "captured_at": "2024-01-14T06:13:28Z",
      "label": "copy captured 2024-01-14",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2021/428.pdf",
      "size": 442639,
      "sha256": "7a7b5cb1d32829c299eb55ae8c3270fc8f29d97bb032d64e7dc068da0d259283",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260303090525id_/https://eprint.iacr.org/2021/428.pdf",
      "captured_at": "2026-03-03T09:05:25Z",
      "size": 443941
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2021/428.pdf",
      "captured_at": "2024-01-14T06:13:28Z",
      "size": 442639
    }
  ],
  "bibtex": "@misc{cryptoeprint:2021/428,\n      author = {Peter Schwabe and Benoît Viguier and Timmy Weerwag and Freek Wiedijk},\n      title = {A Coq proof of the correctness of X25519 in TweetNaCl},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2021/428},\n      year = {2021},\n      url = {https://eprint.iacr.org/2021/428}\n}"
}
