Skip to main content

Efficient algorithms for computing the Jacobi symbol

Extended abstract

  • Conference paper
  • First Online:
Algorithmic Number Theory (ANTS 1996)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1122))

Included in the following conference series:

  • 2614 Accesses

Abstract

We present two new algorithms for computing the Jacobi Symbol: the right-shift and left-shift κ-ary algorithms. For inputs of at most n bits in length, both algorithms take O(n2/log n) time and O(n) space. This is asymptotically faster than the traditional algorithm, which is based in Euclid's algorithm for computing greatest common divisors. In practice, we found our new algorithms to be about two to three times faster for inputs of 100 to 1000 decimal digits in length.

We also present parallel versions of both algorithms for the CRCW PRAM. One version takes O ɛ (n/log log n) time using O(n 1+ɛ) processors, giving the first sublinear parallel algorithms for this problem, and the other version takes polylog time using a subexponential number of processors.

Computing equipment provided through a grant from the Holcomb Research Institute. A preliminary version of this paper was presented on November 3, 1995 at the AMS meeting at Kent State University, Kent, Ohio.

Supported by the Butler Summer Institute.

Supported by a Butler University Faculty Research Fellowship.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. L. M. Adleman and K. Kompella. Using smoothness to achieve parallelism. In 20th Annual ACM Symposium on Theory of Computing, pages 528–538, 1988.

    Google Scholar 

  2. N. C. Ankeny. The least quadratic nonresidue. Annals of Mathematics 55 (1952) 65–72.

    Google Scholar 

  3. E. Bach. Explicit bounds for primality testing and related problems. Mathematics of Computation 55 (1990) 355–380.

    Google Scholar 

  4. E. Bach. A note on square roots in finite fields. IEEE Transactions on Information Theory 36 (1990).

    Google Scholar 

  5. E. Bach. Realistic analysis of some randomized algorithms. Journal of Computer and System Sciences 42(1) (1991) 30–53.

    Google Scholar 

  6. P. W. Beame, S. A. Cook, and H. J. Hoover. Log depth circuits for division and related problems. SIAM Journal on Computing 15 (1986) 994–1003.

    Google Scholar 

  7. A. K. Chandra, S. Fortune, and R. Lipton. Unbounded fan-in circuits and associative functions. Journal of Computer and System Sciences 30 (1985) 222–234.

    Google Scholar 

  8. B. Chor and O. Goldreich. An improved parallel algorithm for integer GCD. Algorithmica 5 (1990) 1–10.

    Google Scholar 

  9. R. Cole and U. Vishkin. Faster optimal parallel prefix sums and list ranking. Information and Control 81 (1989) 334–352.

    Google Scholar 

  10. G. E. Collins and R. G. K. Loos. The Jacobi symbol algorithm. SIGSAM Bulletin 16(1) (1982) 12–16.

    Google Scholar 

  11. F. Fich and M. Tompa. The parallel complexity of exponentiating polynomials over finite fields. Journal of the ACM 35(4) (1988) 651–667.

    Google Scholar 

  12. C. F. Gauss. Theorematis fundamentalis in doctrina de residuis quadraticis demonstrationes et ampliationes novae. In Werke, volume 2, pages 49–64. K. Gesellshaft der Wissenshaften, Göttingen, 1870.

    Google Scholar 

  13. R. Greenlaw, H. J. Hoover, and W. L. Ruzzo. Limits to Parallel Computation: P-Completeness Theory, Oxford University Press, 1995.

    Google Scholar 

  14. G. H. Hardy and E. M. Wright. An Introduction to the Theory of Numbers. Oxford University Press, 5th edition, 1979.

    Google Scholar 

  15. K. Ireland and M. Rosen. A Classical Introduction to Modern Number Theory. Springer-Verlag, New York, 1982.

    Google Scholar 

  16. T. Jebelean. A generalization of the binary GCD algorithm. In Proceedings of the ACM International Symposium on Symbolic and Algebraic Computation, pages 111–116, Kiev, 1993.

    Google Scholar 

  17. R. Kannan, G. Miller, and L. Rudolph. Sublinear parallel algorithm for computing the greatest common divisor of two integers. SIAM Journal on Computing 16(1) (1987) 7–16.

    Google Scholar 

  18. R. Karp and V. Ramachandran. Parallel algorithms for shared-memory machines. In J. van Leeuwen, editor, Algorithms and Complexity. Elsevier and MIT Press, 1990. Handbook of Theoretical Computer Science, volume A.

    Google Scholar 

  19. N. Koblitz. A Course in Number Theory and Cryptography. Springer-Verlag, New York, 1987.

    Google Scholar 

  20. K. S. McCurley. Odds and ends from cryptology and computational number theory. In Cryptology and Computational Number Theory [22], pages 145–166. American Mathematical Society, 1990.

    Google Scholar 

  21. R. Peralta. A simple and fast probabilistic algorithm for computing square roots modulo a prime number. IEEE Transactions on Information Theory 32(6) (1986) 846–847.

    Google Scholar 

  22. C. Pomerance, editor. Cryptology and Computational Number Theory, volume 42 of Proceedings of Symposia in Applied Mathematics. American Mathematical Society, Providence, Rhode Island, 1990.

    Google Scholar 

  23. J. H. Reif, editor. Synthesis of Parallel Algorithms. Morgan Kaufman, San Mateo, California, 1993.

    Google Scholar 

  24. J. H. Reif and S. R. Tate. Optimal size integer division circuits. In 21st Annual ACM Symposium on Theory of Computing, pages 264–273, 1989.

    Google Scholar 

  25. R. Scheidler and H. C. Williams. A public-key cryptosystem utilizing cyclotomic fields. Designs, Codes and Cryptography 6 (1995) 117–131.

    Google Scholar 

  26. A. Schönhage. Schnelle Berechnung von Kettenbruchentwicklungen. Acta Informatica 1 (1971) 139–144.

    Google Scholar 

  27. A. Schönhage and V. Strassen. Schnelle Multiplikation großer Zahlen. Computing 7 (1971) 281–292.

    Google Scholar 

  28. J. Shallit. On the worst case of three algorithms for computing the Jacobi symbol. Journal of Symbolic Computation 10 (1990) 593–610.

    Google Scholar 

  29. J. Shallit and J. Sorenson. A binary algorithm for the Jacobi symbol. SIGSAM Bulletin 27(1) (1993) 4–11.

    Google Scholar 

  30. J. Shallit and J. Sorenson. Analysis of a left-shift binary GCD algorithm. Journal of Symbolic Computation 17 (1994) 473–486.

    Google Scholar 

  31. J. O. Shallit and M. O. Rabin. Randomized algorithms in number theory. Commun. Pure Appl. Math. 39 (1986) 239–256.

    Google Scholar 

  32. R. Solovay and V. Strassen. A fast Monte Carlo test for primality. SIAM Journal on Computing 6 (1977) 84–85. Erratum in 7 (1978) 118.

    Google Scholar 

  33. J. Sorenson. Two fast GCD algorithms. Journal of Algorithms 16 (1994) 110–144.

    Google Scholar 

  34. J. Sorenson. An analysis of Lehmer's Euclidean GCD algorithm. In Proceedings of the ACM International Symposium on Symbolic and Algebraic Computation, pages 254–258, Montréal, Canada, 1995.

    Google Scholar 

  35. U. Vishkin. Advanced parallel prefix-sums, list ranking and connectivity. In Synthesis of Parallel Algorithms[23], pages 215–257. Morgan Kaufman, San Mateo, California, 1993.

    Google Scholar 

  36. K. Weber. The accelerated integer GCD algorithm. ACM Transactions on Mathematical Software 21(1) (1995) 111–122.

    Google Scholar 

  37. H. C. Williams. A modification of the RSA public-key encryption procedure. IEEE Transactions on Information Theory 26(6) (1980) 358–368.

    Google Scholar 

  38. H. C. Williams. An m3 public-key encryption scheme. In Advances in Cryptology — CRYPTO'85 Proceedings, Berlin, 1986. Springer-Verlag.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Henri Cohen

Rights and permissions

Reprints and permissions

Copyright information

© 1996 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Meyer, S.M., Sorenson, J.P. (1996). Efficient algorithms for computing the Jacobi symbol. In: Cohen, H. (eds) Algorithmic Number Theory. ANTS 1996. Lecture Notes in Computer Science, vol 1122. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61581-4_58

Download citation

  • DOI: https://doi.org/10.1007/3-540-61581-4_58

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-61581-1

  • Online ISBN: 978-3-540-70632-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics