{
  "id": "2020/972",
  "url": "https://opencryptology.org/2020/972",
  "original_url": "https://eprint.iacr.org/2020/972",
  "title": "Optimized Binary GCD for Modular Inversion",
  "authors": [
    "Thomas Pornin"
  ],
  "affiliations": null,
  "abstract": "In this short note, we describe a practical optimization of the\nwell-known extended binary GCD algorithm, for the purpose of computing\nmodular inverses. The method is conceptually simple and is applicable\nto all odd moduli (including non-prime moduli). When implemented\nfor inversion in the field of integers modulo the prime $2^{255}-19$, on\na recent x86 CPU (Coffee Lake core), we compute the inverse in 6253\ncycles, with a fully constant-time implementation.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Optimized Binary GCD for Modular Inversion” by Thomas Pornin, Cryptology ePrint Archive, Paper 2020/972, https://eprint.iacr.org/2020/972. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": true,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2020-08-18T08:23:54Z",
    "updated": "2020-08-23T18:24:11Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2020/972.pdf",
    "sha256": "f66c3c630953797ea6cdf0507ed79e3623189a73d6d00d3a05bea8a67646d534",
    "size": 533662,
    "source": "github-mirror",
    "source_date": "2024-01-14T06:13:14Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2020/972/versions/20240114T061314Z.pdf",
      "captured_at": "2024-01-14T06:13:14Z",
      "label": "copy captured 2024-01-14",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2020/972.pdf",
      "size": 533662,
      "sha256": "f66c3c630953797ea6cdf0507ed79e3623189a73d6d00d3a05bea8a67646d534",
      "is_default_pdf": true
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260913023134id_/https://eprint.iacr.org/2020/972.pdf",
      "captured_at": "2026-09-13T02:31:34Z",
      "size": 534996
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2020/972.pdf",
      "captured_at": "2024-01-14T06:13:14Z",
      "size": 533662
    }
  ],
  "bibtex": "@misc{cryptoeprint:2020/972,\n      author = {Thomas Pornin},\n      title = {Optimized Binary GCD for Modular Inversion},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2020/972},\n      year = {2020},\n      url = {https://eprint.iacr.org/2020/972}\n}"
}
