{
  "id": "2023/828",
  "url": "https://opencryptology.org/2023/828",
  "original_url": "https://eprint.iacr.org/2023/828",
  "title": "Optimized Discrete Logarithm Computation for Faster Square Roots in Finite Fields",
  "authors": [
    "Thomas Pornin"
  ],
  "affiliations": null,
  "abstract": "For computing square roots in a finite field $GF(q)$ where $q - 1 = 2^n m$ for an odd integer $m$ and some integer $n$, the classic Tonelli-Shanks algorithm starts with an exponentiation (the exponent has size about $\\log_2 q - n$ bits), followed by a discrete logarithm computation in the subgroup of $2^n$-th roots of unity in $GF(q)$; the latter operation has cost $O(n^2)$ multiplications in the field, which is prohibitive when $n$ is large. Bernstein proposed an optimized variant with lookup tables, leading to a runtime cost of $O((n/w)^2)$, using $w$-bit tables of cumulative size $O(2^w n/w)$. Sarkar recently improved on the runtime cost, down to $O((n/w)^{1.5})$, with the same overall storage cost. In this short note, we explore the use of a straightforward divide-and-conquer variant of the Pohlig-Hellman algorithm, bringing the asymptotic cost down to $O(n\\log n)$, and further study some additional optimizations. The result appears to be competitive, at least in terms of number of multiplications, for some well-known fields such that the 224-bit field used in NIST standard elliptic curve P-224 (for which $n = 96$).",
  "category": "Implementation",
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Optimized Discrete Logarithm Computation for Faster Square Roots in Finite Fields” by Thomas Pornin, Cryptology ePrint Archive, Paper 2023/828, https://eprint.iacr.org/2023/828. Licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/).",
    "retroactive": false,
    "redistribute_verbatim_only": false,
    "non_commercial": false
  },
  "dates": {
    "submitted": "2023-06-04T18:24:53Z",
    "updated": "2025-11-01T18:10:33Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2023/828.pdf",
    "sha256": "730637a68e3269eae03dfbfceef83b2fb1a51ff434215127dac66ac77db4b9d2",
    "size": 143865,
    "source": "github-mirror",
    "source_date": "2026-04-28T17:20:00Z",
    "maybe_stale": false,
    "newer_on_eprint": null,
    "withdrawn": false
  },
  "versions": [
    {
      "url": "https://opencryptology.org/2023/828/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/2023/828.pdf",
      "size": 143865,
      "sha256": "730637a68e3269eae03dfbfceef83b2fb1a51ff434215127dac66ac77db4b9d2",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2023/828/versions/20230606T090300Z.pdf",
      "captured_at": "2023-06-06T09:03:00Z",
      "label": "copy captured 2023-06-06",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20230606090300id_/https://eprint.iacr.org/2023/828.pdf",
      "size": 289900,
      "sha256": "2eb1fe5c13b2a96b6e204bc2ae3bd3bdeb004e8078e0866c0cad730d89b4da5a",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2023/828.pdf",
      "captured_at": "2026-04-28T17:20:00Z",
      "size": 143865
    },
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260312144707id_/https://eprint.iacr.org/2023/828.pdf",
      "captured_at": "2026-03-12T14:47:07Z",
      "size": 145143
    }
  ],
  "bibtex": "@misc{cryptoeprint:2023/828,\n      author = {Thomas Pornin},\n      title = {Optimized Discrete Logarithm Computation for Faster Square Roots in Finite Fields},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2023/828},\n      year = {2023},\n      url = {https://eprint.iacr.org/2023/828}\n}"
}
