The method of quadratic Shanks forms is a method of factorization of integers , based on the application of quadratic forms , developed by Daniel Shanks ( . [1] in 1975 , as a development of Fermat's factorization method .
For 32-bit computers, algorithms based on this method are the undisputed leaders among factorization algorithms for numbers from before and probably will remain so. [2] This algorithm can split almost any composite 18-digit number in less than a millisecond. The algorithm is extremely simple, beautiful and efficient. In addition, methods based on this algorithm are used as auxiliary methods in the expansion of divisors of large numbers such as Fermat numbers .
Content
History
Another name for the algorithm is SQUFOF (the acronym for English is SQUare FOrm Factorization), which means factorization using the quadratic form method. This approach has been quite successful over the years and, as a result, quite a lot of different modifications and implementations can be found on this topic in the literature. [3] Most of the methods are complicated and confusing, especially when it is necessary to implement the method on a computer. As a result, many variants of the algorithms are not suitable for implementation. However, in 1975, Daniel Shanks proposed creating an algorithm that can be implemented and used not only on a computer, but also on a simple mobile phone.
Although Shanks described other algorithms for factoring integers, he did not publish anything on SQUFOF. He gave lectures on this topic and explained the main essence of his method to a rather small circle of people. Some works of other scientists [4] [3] [5] [6] discussed the algorithm, but none contain a detailed analysis. It is also interesting that Shanks makes a rather large number of assumptions in his method [7] , which, unfortunately, remained without proof. In [8] , the results of some experiments are presented, which indicate that many assumptions hold true. As a result, based on these simplifying assumptions, Shanks managed to create SQUFOF.
Auxiliary definitions
In order to understand how this algorithm is implemented, it is necessary to find out the minimum information about the mathematical objects used in this method, namely, quadratic forms . A binary quadratic form is called a polynomial in two variables and :
The Shanks method uses only vague forms . Under we will understand the discriminant of a quadratic form. We say that the quadratic form represents an integer if such integers exist that equality holds: . If the equality holds , then the representation is called primitive .
For any indefinite quadratic form it is possible to define a reduction operator as:
- ,Where - defined as an integer uniquely determined by the conditions: [8]
Result of using the operator to form times recorded as . An operator is also defined. as:
- where defined as in the previous case. Note that as a result of applying the operators and to quadratic form with discriminant obtained quadratic forms will also have discriminant .
A method for obtaining a reduced form equivalent to this one was found by Karl Gauss and consists in the sequential application of the reduction operator , until will not be reduced.
Theorem.
|
Also, for clarity of understanding of all operations with quadratic forms, we need the concepts of square, adjacent and ambiguous quadratic forms
Options
The idea of the Shanks method is to match the number , which must be decomposed, quadratic binary form with discriminant with which a series of equivalent transformations and the transition from form are then performed ambiguous . Then, will be a divider .
The first option works with positively defined binary quadratic forms of a given negative discriminant, and in the group of classes of forms it finds an Ambigu form that decomposes the discriminant into factors. The complexity of the first option is subject to the truth of the extended Riemann hypothesis . [9]
The second option is SQUFOF, it uses a group of classes of binary quadratic forms with positive discriminant. In it, the ambit form is also found and the discriminant is factorized. SQUFOF difficulty is arithmetic operations; the algorithm works with integers not exceeding . Among exponential complexity factorization algorithms, SQUFOF is considered one of the most efficient. [9]
Convergence Rating
According to the calculations performed by Shanks himself, the number of iterations of the first and second cycles of the algorithm is determined by the number number factors and is approximately equal to:
Where - a constant of approximately 2.4 for the first iteration cycle. [ten]
Algorithm Description
In more detail, the algorithm can be written as follows: [11]
Input: Odd Compound to be factorized. If a replace on Now The last property requires that the determinant of the quadratic form be fundamental, which ensures the convergence of the method.
Output: Nontrivial Divider .
- 1. Define the initial quadratic form , with discriminant where .
- 2. Perform a reduction cycle while form will not become square.
- 3. Calculate the square root of
- 4. We carry out the reduction cycle until the value of the second coefficient stabilizes . Number of iterations this loop should be approximately equal to half the number of iterations of the first loop. Last value will give a divisor of a number (possibly trivial).
Algorithm Implementation
Now we describe the algorithm for implementation on a computer. [11] Note that although the theoretical part of the algorithm is associated with equivalent transformations of quadratic forms, the practical part of the algorithm is based on the calculation of the method of continued fractions without resorting to forms. Each iteration of the cycle corresponds to one operation of applying the reduction operator to the corresponding form. If necessary, you can restore the appropriate forms. according to the formulas:
Input: Compound
Output: Nontrivial Divider
- Initialization of the algorithm.
- Check whether full square. If yes, then calculate and complete the calculation. Otherwise, move on to the next item.
- If a then replace on Define
- Define the initial values of the parameters
- First cycle
- We continue to calculate the coefficients until we find Q_k, which is a full square. This should happen with some Let be for the whole Let's move on to the next cycle.
- Second cycle.
- start the cycle of computing new parameters The formulas for the implementation of the second cycle will remain the same as before. Only the initial parameter values will change
- The calculation should continue until two consecutive values will not be equal. Then, the value will give the desired divisor of the number The description of the Shanks algorithm is complete.
As already mentioned, this is not the only implementation of this algorithm. Implementations of the algorithm can also be found here [8]
Example of factorization of a number
We apply this method to factorize a number [eight]
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Now you can see in the second cycle that Hence the number
Applications
This algorithm is used in many implementations of NFS and QS to factorize small auxiliary numbers that occur when factorizing a large integer. In any case, SQUFOF is mainly used as an auxiliary algorithm in more powerful factorization algorithms and, therefore, SQUFOF will usually be used to factorize numbers of modest sizes that do not have small prime divisors. Such numbers are usually the product of a small number of different primes. [8] .
Notes
- ↑ More details about the history of this method and its relation to the continuous fraction method can be found in the article by J. Gover, SS Wagstaff.
- ↑ Yike Guo, 1999 , High Performance Data Mining: Scaling Algorithms, Applications and Systems ..
- ↑ 1 2 Hans Riesel, 1994 , Prime Numbers and Computer Methods for Factorization. Birkhauser, second edition.
- ↑ Henri Cohen, 1996 , A Course in Computational Algebraic Number Theory ..
- ↑ DA Buell, 1989 , Binary Quadratic Forms.
- ↑ Samuel S. Wagstaff Jr., 2003 , Cryptanalysis of Number Theoretic Ciphers.
- ↑ For example, SQUARE FORM FACTORIZATION JASON E. GOWER AND SAMUEL S. WAGSTAFF, JR. Assumption 4.12. on page 20, Assumption 4.5 on page 16, also in proving theorems on the complexity of the algorithm, etc.
- ↑ 1 2 3 4 5 SQUARE FORM FACTORIZATION, 2003 , SQUARE FORM FACTORIZATION.
- ↑ 1 2 Vasilenko, 2003 , Number-theoretic algorithms in cryptography.
- ↑ Ishmukhametov, 2011 , Methods of factorization of natural numbers: Textbook.
- ↑ 1 2 Ishmukhametov, 2011 , Methods of factorization of natural numbers: Textbook p. 79-80.
Literature
- Vasilenko O. N. Number-theoretic algorithms in cryptography . - Moscow: ICMMO, 2003 .-- S. 75 - 76. - 328 p. - ISBN 5-94057-103-4 . Archived January 27, 2007 on the Wayback Machine
- Ishmukhametov Sh. T. Methods of factorization of natural numbers: Textbook . - Kazan: Kazan University, 2011 .-- S. 74 - 82. - 190 p.
- DA Buell. Binary Quadratic Forms . - New York: Springer-Verlag, 1989 .-- S. 197 - 199. - ISBN 0-387-97037-1 .
- Hans Riesel. Prime Numbers and Computer Methods for Factorization. Birkhauser, second edition. - Sweden: Birkhauser, 1994. - S. p. 186 - 192. - ISBN 978-0-8176-8297-2 .
- Henri Cohen. A Course in Computational Algebraic Number Theory .. - Springer-Verlag, 1996. - S. 433 - 437. - ISBN 3-540-55640-0 .
- Jason E. Gower and Samuel S. Wagstaff, JR. SQUARE FORM FACTORIZATION . - Moscow: MCLMO, 2003 .-- S. 1-16, 35-36. - 38 p. - ISBN 5-94057-103-4 .
- Samuel S. Wagstaff Jr. Cryptanalysis of Number Theoretic Ciphers. - CRC Press, 2003. - ISBN 978-1584881537 .
- Yike Guo, RL Grossman. High Performance Data Mining: Scaling Algorithms, Applications and Systems .. - Kluwer Academic Publishers, 1999 .-- S. 111. - ISBN 0-7923-7745-1 .
See also
- Factoring integers