{
  "id": "2018/1038",
  "url": "https://opencryptology.org/2018/1038",
  "original_url": "https://eprint.iacr.org/2018/1038",
  "title": "On inversion modulo pseudo-Mersenne primes",
  "authors": [
    "Michael Scott"
  ],
  "affiliations": null,
  "abstract": "It is well established that the method of choice for implementing a side-channel secure modular inversion, is to use Fermat's little theorem. So $1/x = x^{p-2} \\bmod p$. This can be calculated using any multiply-and-square method safe in the knowledge that no branching or indexing with potentially secret data (such as $x$) will be required. However in the case where the modulus $p$ is a pseudo-Mersenne, or Mersenne, prime of the form $p=2^n-c$, where $c$ is small, this process can be optimized to greatly reduce the number of multiplications required. Unfortunately an optimal solution must it appears be tailored specifically depending on $n$ and $c$. What appears to be missing from the literature is a near-optimal heuristic\nmethod that works reasonably well in all cases.",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“On inversion modulo pseudo-Mersenne primes” by Michael Scott, Cryptology ePrint Archive, Paper 2018/1038, https://eprint.iacr.org/2018/1038. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": true,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2018-10-30T18:53:31Z",
    "updated": "2020-07-16T10:14:46Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2018/1038.pdf",
    "sha256": "2d2e75dc742c757388998181a6418468ee80b9d88d105731193e44d73d3929be",
    "size": 99867,
    "source": "wayback",
    "source_date": "2026-01-09T20:59:37Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2018/1038/versions/20260109T205937Z.pdf",
      "captured_at": "2026-01-09T20:59:37Z",
      "label": "copy captured 2026-01-09",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20260109205937id_/https://eprint.iacr.org/2018/1038.pdf",
      "size": 99867,
      "sha256": "2d2e75dc742c757388998181a6418468ee80b9d88d105731193e44d73d3929be",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2018/1038/versions/20200417T103614Z.pdf",
      "captured_at": "2020-04-17T10:36:14Z",
      "label": "copy captured 2020-04-17",
      "source": "github-mirror",
      "source_url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2018/1038.pdf",
      "size": 99870,
      "sha256": "378cbe50f2e8644dc0bb2a79dc7b804493e6e5c288ddf674f2b0d6db155a149f",
      "is_default_pdf": false
    },
    {
      "url": "https://opencryptology.org/2018/1038/versions/20190218T001453Z.pdf",
      "captured_at": "2019-02-18T00:14:53Z",
      "label": "copy captured 2019-02-18",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20190218001453id_/https://eprint.iacr.org/2018/1038.pdf",
      "size": 76219,
      "sha256": "fc724bdf9a21b475b94ac5aeb3bd9958db2897d3419a0e236fcedfdda2163067",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260109205937id_/https://eprint.iacr.org/2018/1038.pdf",
      "captured_at": "2026-01-09T20:59:37Z",
      "size": 100728
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2018/1038.pdf",
      "captured_at": "2020-04-17T10:36:14Z",
      "size": 99870
    }
  ],
  "bibtex": "@misc{cryptoeprint:2018/1038,\n      author = {Michael Scott},\n      title = {On inversion modulo pseudo-Mersenne primes},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2018/1038},\n      year = {2018},\n      url = {https://eprint.iacr.org/2018/1038}\n}"
}
