Kunerth's algorithm

From testwiki
Revision as of 22:04, 20 January 2025 by imported>Lambiam (top: {{expert needed}})
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Template:Expert needed

Kunerth's algorithm is an algorithm for computing the modular square root of a given number.[1][2] The algorithm does not require the factorization of the modulus, and uses modular operations that are often easy when the given number is prime.

Algorithm

To find y from a given value

B=y2modN,

it takes the following steps:

  1. Find the modular square root r±N(modB). This step is quite easy when B is a prime, irrespective of how large N is.
  2. Solve a quadratic equation associated with the modular square root of w2=Az2+Bz+C. Most of Kunerth's examples in his original paper solve this equation by having C be a integer square and thus setting z to zero.
    Expand the left hand side of the following equation:
    ((Bz+r)2+(BFN))/B=w2.
    Expanding the left hand side results in a quadratic form Az2+Dz+C+F. One can then make sure that the equation can be solved by adjusting F so as to make C+F a square.
  3. Having solved the associated quadratic equation we now have the variables w and set v = r (if C in the quadratic is a natural square).
  4. Solve for variables α and β the following equation:
    α=w(v+wβ),
  5. Obtain a value for X via factorization of the following polynomial:
    α2x2+(2αβN)x+(β2(y2modN))
    obtaining an answer like
    (37+9x)(1+25x)
  6. Obtain the modular square root by the equation. Remember to set X such that the term above is zero. Thus X would be 37/9 or -1/25.
    yαX+β(modN).

Example

To obtain 41mod856, first obtain 85613(mod41).

Then expand the polynomial:

((41z+13)2+856)/41=w2

into

25+26z+41z2

Since, in this case the C term is a square, we take w=5 and compute v=13 (in general, v=41z+13).

Solve for α and β the following equation
α==w(v+wβ)
getting the solution α=15 and β=2. (There may be other pairs of solutions to this equation.)
Then factor the following polynomial:
α2x2+(2αβ856)x+(β241)
obtaining
(37+9x)(1+25x)
Then obtain the modular square root via
15(3791)+(2)345(mod856).
Verify that 345241(mod856).

In the case that 856mod41 has no answer, then r856(modb856+41) can be used instead.

See also

References

Template:Reflist

  • Adolf Kunerth, "Sitzungsberichte. Academie Der Wissenschaften" vol 75, II, 1877, pp. 7–58
  • Adolf Kunerth, "Sitzungsberichte. Academie Der Wissenschaften" vol 82, II, 1880, pp. 342–375

Template:Number theoretic algorithms

  1. Adolf Kunerth, "Sitzungsberichte. Academie Der Wissenschaften" vol 78(2), 1878, p 327-338 (for quadratic equation algorithm), pp. 338–346 (for modular quadratic algorithm), available at Ernest Mayr Library, Harvard University url="https://pdfhost.io/v/~OwxzpPNA_KUNERTH_1878" retrieved="09/09/2024"
  2. Leonard Eugene Dickson, "History of Numbers", vol 2, pp. 382–384.