{
  "id": "2021/1271",
  "url": "https://opencryptology.org/2021/1271",
  "original_url": "https://eprint.iacr.org/2021/1271",
  "title": "Computing the Jacobi symbol using Bernstein-Yang",
  "authors": [
    "Mike Hamburg"
  ],
  "affiliations": null,
  "abstract": "Number-theoretic algorithms often need to calculate one or both of two related quantities: modular inversion and Jacobi symbol.  These two functions seem unrelated at first glance, but in fact the algorithms for calculating them are closely related: they can both be calculated either by variants of Euclid's GCD algorithm, or when the modulus is prime, by exponentiation.  As a result, an implementation of one algorithm can often be adapted to compute the other instead, or they can even be calculated together in a batch.\n\nThe Bernstein-Yang right-to-left modular inversion algorithm is notable for taking constant, asymptotically subquadratic time.  Right-to-left algorithms are tricky to adapt for the Jacobi symbol, because they do not consider the signs of the values being operated on.  But the Jacobi symbol is defined only on positive integers, and the rules for computing it need corrections if negative integers are introduced.\n\nIn this short paper, we show how to overcome this difficulty and produce a right-to-left Jacobi symbol algorithm based on Bernstein-Yang.",
  "category": null,
  "license": {
    "code": "CC BY",
    "url": "https://creativecommons.org/licenses/by/4.0/",
    "label": "CC BY 4.0",
    "attribution": "“Computing the Jacobi symbol using Bernstein-Yang” by Mike Hamburg, Cryptology ePrint Archive, Paper 2021/1271, https://eprint.iacr.org/2021/1271. 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-09-23T07:00:03Z",
    "updated": "2021-12-17T22:28:26Z",
    "withdrawn": null
  },
  "withdrawn": false,
  "withdrawn_on": null,
  "pdf": {
    "url": "https://opencryptology.org/2021/1271.pdf",
    "sha256": "d78ef0a41fc9cb3c4683fd0755cc846573ddcc533b9e873ff7d0f30b16159f06",
    "size": 234639,
    "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/1271/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/1271.pdf",
      "size": 234639,
      "sha256": "d78ef0a41fc9cb3c4683fd0755cc846573ddcc533b9e873ff7d0f30b16159f06",
      "is_default_pdf": true
    },
    {
      "url": "https://opencryptology.org/2021/1271/versions/20211027T134329Z.pdf",
      "captured_at": "2021-10-27T13:43:29Z",
      "label": "copy captured 2021-10-27",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20211027134329id_/https://eprint.iacr.org/2021/1271.pdf",
      "size": 234611,
      "sha256": "30e9908f2ff1cc11660e58108e864de97323d678e392baa5fb20d3840150bfd2",
      "is_default_pdf": false
    },
    {
      "url": "https://opencryptology.org/2021/1271/versions/20210923T182740Z.pdf",
      "captured_at": "2021-09-23T18:27:40Z",
      "label": "copy captured 2021-09-23",
      "source": "wayback",
      "source_url": "https://web.archive.org/web/20210923182740id_/https://eprint.iacr.org/2021/1271.pdf",
      "size": 232528,
      "sha256": "52fde877131bbc7a891326a7f4db6b179cdddce8ec33f2c9322a09e483d29057",
      "is_default_pdf": false
    }
  ],
  "other_sources": [
    {
      "kind": "wayback",
      "url": "https://web.archive.org/web/20260217213843id_/https://eprint.iacr.org/2021/1271.pdf",
      "captured_at": "2026-02-17T21:38:43Z",
      "size": 235922
    },
    {
      "kind": "github-mirror",
      "url": "https://raw.githubusercontent.com/arturo-kong/IACR-eprint-mirror/master/2021/1271.pdf",
      "captured_at": "2024-01-14T06:13:28Z",
      "size": 234639
    }
  ],
  "bibtex": "@misc{cryptoeprint:2021/1271,\n      author = {Mike Hamburg},\n      title = {Computing the Jacobi symbol using Bernstein-Yang},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2021/1271},\n      year = {2021},\n      url = {https://eprint.iacr.org/2021/1271}\n}"
}
