The present invention is related to solving an equation in two or more unknown integer variables, where each variable is represented by a multiplicity of powers of multiples of an odd prime p. Specifically, the present invention is related to factoring an integer N0, restating the problem into the factorization of an appropriate integer N which is a quadratic residue modulo p, then factoring N.
The problem of resolving a large integer into the product of its prime factors has stimulated the intellectual curiosity and the imagination of many generations of mathematicians.
In 1801 Gauss wrote: “. . . the dignity of the science itself seems to require that every possible means be explored for the solution of a problem so elegant and so celebrated.” See page 397 of [3].
The problem has attracted renewed interest, ever since R. L. Rivest, A. Shamir, and L. Adleman proposed an encryption method which is based on the computational difficulty of the factorization problem [4].
This note introduces a method and apparatus which lead to the factorization of a large odd integer N0.
The present invention pertains to a method for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers. The method comprises the steps of obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non-transient memory. There is the step of storing the signal W in a second non-transient memory. There is the step of decoding with a second computer in communication with the second non -transient memory the signal W in the second non-transient memory by factoring the public key N0 in at most a time O(log6N0) with the second computer generated steps of selecting integers a, b. There is the step of electing an initial point in a set of quartuples of integers modulo N0 (a projective space) [X0, X1, X2, X3]=[1,0,b,0]. There is the step of applying a semigroup law repeatedly starting from the initial point, where the semigroup law is defined as: given a pair of elements [X0: X1: X2: X3] and [Y0: Y1: Y2: Y3] of the projective space, there is produced a third point [Z0, Z1, Z2, Z3]. There is the step of determining that [X0: X1: X2: X3]=[Y0: Y1: Y2: Y3] (mod N0), and thus the third point is
Otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
The present invention pertains to a second computer for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s. The second computer comprises an input for obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non-transient memory, a second non-transient memory in communication with the input in which the signal W is stored. The second computer comprises a cpu in communication with the second non-transient memory with the signal W in the second non-transient memory that decodes the signal W by factoring the public key N0 in time O(log6N0) by the second computer generated steps of selecting integers a, b. There is the step of electing an initial point in a set of quartuples of integers modulo N0 (a projective space) [X0, X1, X2, X3]=[1,0,b,0]. There is the step of applying a semigroup law repeatedly starting from the initial point, where the semigroup law is defined as: given a pair of elements [X0: X1: X2: X3] and [Y0: Y1: Y2: Y3] of the projective space, there is produced a third point [Z0, Z1, Z2, Z3]. There is the step of determining that [X0: X1: X2: X3]≡[Y0: Y1: Y2: Y3] (mod N0), and thus the third point is
Otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. The cpu decrypting the signal W with the public key N0 and prime factors of integer N0. The cpu reviewing the decrypted signal W for predetermined words to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be quickly acted upon to eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
The present invention pertains to a non-transitory readable storage medium which includes a computer program stored on the storage medium for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s, where the signal W has been stored in a second non-transient memory of a second computer, and the second computer factoring the public key N0 in time O(log6N0). The signal W obtained from a telecommunications network, or a data network or an Internet or a first non-transient memory. The computer program having the second computer generated steps of selecting integers a, b. There is the step of electing an initial point in a set of quartuples of integers modulo N0 (a projective space) [X0, X1, X2, X3]=[1,0,b,0]. There is the step of applying a semigroup law repeatedly starting from the initial point, where the semigroup law is defined as: given a pair of elements [X0: X1: X2: X3] and [Y0: Y1: Y2: Y3] of the projective space, there is produced a third point [Z0, Z1, Z2, Z3]. There is the step of determining that [X0: X1: X2: X3]≡[Y0: Y1: Y2: Y3] (mod N0), and thus the third point is
Otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
The present invention pertains to a method for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers. The method comprises the steps of obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non-transient memory. There is the step of storing the signal W in a second non-transient memory. There is the step of decoding with a second computer in communication with the second non-transient memory the signal W in the second non-transient memory by factoring the public key N0 in at most a time O(log6N0) with the second computer generated steps of selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
The present invention pertains to a second computer for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s. The second computer comprises an input for obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non-transient memory. The second computer comprises a second non-transient memory in communication with the input in which the signal W is stored. The second computer comprises a cpu in communication with the second non -transient memory with the signal W in the second non-transient memory. The cpu decodes the signal W by factoring the public key N0 in time O(log6N0) by the second computer generated steps of selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. The cpu decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. The cpu reviewing the decrypted signal W for predetermined words to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
The present invention pertains to a non-transitory readable storage medium which includes a computer program stored on the storage medium for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s, where the signal W has been stored in a second non-transient memory of a second computer, and the second computer factoring the public key N0 in time O(log6N0). The signal W obtained from a telecommunications network, or a data network or an Internet or a first non-transient memory. The computer program having the second computer generated steps of: selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
Given a positive odd integer N0, it is desired to determine a pair of integers r0 and s0 such that
N0=r0·s0. (1)
The problem can also be stated as the search for two integers Y0and X0such that Y0>X0 and
N0=Y02−X02. (2)
The pairs (r0, s0) and (Y0, X0) are related as follows:
Conversely,
If r0>s0>0, both Y0 and X0 are positive. In this case it is useful to consider some limit cases in order to develop an appreciation for the magnitude of the variables.
One of the limit cases occurs when the pair (r0, s0) is a pair of “twin primes”, such as (43, 41). In these cases,
At the other end is the case when r0 approximates N0. At the limit, consider a pair (r0, s0) equaling (N0, 1). Then
Therefore, in all cases
Thus, in all cases, Y02>N0. In some cases, X02 is greater than N0.
Given N0 and an odd prime p, the general solution of (1) has the following form:
where α, β, λ0, and μ0 denote integers and where α·β≡N0 (mod p). If α and β are both even or both odd, λ0 and μ0 have the same parity. Otherwise, define β′=β+p and μ′0=μ0−1. Thus, without loss of generality, it is possible to define two integers U0 and V0 as follows:
Then
The integers V0 and U0 are usually referred to as the symmetric and antisyrnmetric components of the pair (r0, s0), respectively. In general, in the search for (U0, V0), all values of α in the interval 1≤α<p may need to be tested.
The complexity of the problem is reduced in the cases when
In such cases V0≡0 (mod p).
In order to realize this situation, it is possible to restate the problem of factoring N0 into the problem of factoring some integer N which satisfies (11). To this end, select a prime p, and let n0 be the unique integer with pn
N0≡τ·{tilde over (α)}2 (mod p2). (12)
Let {tilde over (τ)} denote the least positive residue of (12). Then β≡{tilde over (τ)}·{tilde over (α)} (mod p). If {tilde over (τ)} is odd, define the integer N by the following
N={tilde over (τ)}·N0 (13)
where, for some integer n, pn−1<N<pn. Then N is a quadratic residue modulo p and
N≡{tilde over (τ)}2·{tilde over (α)}2 (mod p). (14)
Note that now there is a factorization N=r·s, with r≡s (mod p), namely r={tilde over (τ)}r0 and s=s0. There exist unique integers U and V such that
where
Notice that, if U>0, r>s.
In the case of (15), it will be
Also, since {tilde over (τ)} is odd,
The factorization problem requires the identification of a pair (Ũ, {tilde over (V)}) such that, for the corresponding ({tilde over (r)}, {tilde over (s)}), it is
N={tilde over (r)}·{tilde over (s)}. (19)
In general, all the values of α should be tested.
Consider the expression of Y when à is used in lieu of {tilde over (τ)}·{tilde over (α)}:
for some integer V1. Recall that, by (7),
√{square root over (N)}<Y<N. (21)
There are two significant particular cases: if Ã<√{square root over (N)}, then V1>0. Also, if Ã>N, then V1<0. Throughout this presentation, Ã will be greater than N. For simplicity of notation, the integer V will be constrained to be positive. Then (15) takes the following form:
A particular definition of N can be produced when τ is computed modulo pn
Given pn−1<N<pn, where N is a quadratic residue modulo p, let
where {vi} denote integers, and 0≤vi<p.
It is desired to compute a solution of the following:
N≡A2 (mod pn) (24)
where
and where
0≤αi<p. (26)
Subject to (26), the solution of (24) is provided by the following:
where RHi and LHi denote the RHS and LHS, respectively, of the congruence containing vi.
The terms (RHi−LHi)/p are usually referred to as carries. They are caused by the constraint (26) and flow from the less significant digits to the more significant ones. As an example, consider the problem of solving
N≡A2 (mod p5), (28)
where N is a quadratic residue modulo p. Assume p=13 and
If 0≤αi<p, a solution of (28), say Ã, can be represented as follows:
Ã=6+0·p+3·p2+10·p3+5·p4. (30)
A second solution of (28) occurs when {tilde over (α)}0=6 is replaced by
Ā=7+12·p+9·p2+2·p3+7·p4. (31)
Consider removing the magnitude constraints (26) from all αi and representing A as
A≡ω0+ω1·p+ω2·p2+ω3·p3+ω4·p4 (mod p5), (32)
where the coefficients of any power of p are positive integers and are constrained by the following conditions:
0≤ωi<pn−i. (33)
Then the congruence (28) can be satisfied if the sum of the coefficients of any power of p, say pi, is congruent to zero modulo p5−i. Specifically, in the example, it must be
In the example, consider the condition
10≡ω02 (mod p5) (35)
For ω0≡6 (mod p) , the least positive solution, say {tilde over (ω)}0, is {tilde over (ω)}0=181200. For {tilde over (ω)}0≡p−6≡7 (mod p), it is
2·p≡2·{tilde over (ω)}0·ω1·p (mod p5). (36)
The least positive solution, say {tilde over (ω)}1, is {tilde over (ω)}1=18120.
Thereafter, from the third of (34), let
10·p2≡({tilde over (ω)}12+2·{tilde over (ω)}0·{tilde over (ω)}2)·p2 (mod p5), (37)
whence {tilde over (ω)}2=1814. Likewise, from the fourth of (34), let
5·p3≡2·{tilde over (ω)}1·{tilde over (ω)}2·p3+2·ω0·ω3·p3 (mod p5), (38)
whence {tilde over (ω)}3=97. Finally, from the fifth of (34), let
0·p4≡ω22·p4+2ω1·ω3p4+2ω0·p4 (mod p5), (39)
whence {tilde over (ω)}4=12. Then
N≡(181200+18120·p+1814·p2+97·p3+12·p4)2 (mod p5) (40)
Proceeding in a similar fashion with
N≡(190093+10441·p+383·p2+72·p3+1·p4)2 (mod p5) (41)
Comparison of the resulting {tilde over (ω)}i with the corresponding
or
(ωi+
Thus, in the example,
and
Ã+Ā=5·p5. (45)
Notice that, when à and Ā are subject to the constraint (26), as in (40) and (31), their sum equals 5p5.
Comparing the representations of à of (40) and (30), it can be stated that the representation proposed by (40) entails an equipartition of weight among the 5 degrees of freedom of (32).
Remark 1. In the example, each coefficient {tilde over (ω)}i of à is computed modulo p5−i. If the magnitude constraint (26) were to be applied to the coefficients on the RHS of (40) and (41), the coefficients ωi would be reduced modulo p and the structure (34) would be demolished.
In practice, the integer N, as represented on the RHS of (40) and (41), should be treated as a polynomial in some integer variable u, say P(u), where P(u) happens to be computed at u=p.
Remark 2. In (32) the representation of the coefficients ωi i is arbitrary. In (40) and (41) such coefficients are represented in base 10. They may be represented in any other base, such as p.
Remark 3. It should be noted that in (28) p4<N<p5 and in (32) A is being defined modulo p5. In general, such may not be the case. It is possible that A be defined modulo a larger power of p, depending on the requirements of the problem on hand. A similar situation occurs in the domain of irrational numbers, such as √{square root over (2)}. √{square root over (2)} may be computed with a large number of decimal digits, depending on the precision required by the problem on hand. No harm is done if the precision of the computed value of √{square root over (2)} is greater than needed.
As an example, consider the case when p=13 and N1<p2. Assume that N1=v0+v1·p=10+2·p. It is desired to solve
N1≡A2 (mod p5). (46)
In this case the integers ωi are defined by the following:
For ω0=6 (mod p), the result is
Compare with (40).
Remark 4. As a further application of this method of representation of integers, consider the problem of computing Ã−1 (mod p5) when à is defined as in (32). Let
Ā−1≡w0+w1·p+w2·p2+w3·p3+w4·p4 (mod p5) (49)
and
÷Ã−1≡1 (mod p5) (50)
The coefficients wi should be defined as the least positive solutions of the following:
In the example, Ã−1≡18120+26749·p+1590·p2+73·p3+9·p4 (mod p5). The product ÷Ã−1 also contains the following terms:
This section summarizes the approach of U.S. Pat. No. 10,298,393 B1. This is generalized and improved upon via standard polynomials later.
Given p and N, select à as one of the solutions of (24) modulo pn, computed using the procedure described in Section 7. Assume Ã>pn.
Then, using (26), let
N=Ã2U2·p2−2·Ã·V·p2+V2·p4, (53)
where
Referring to (40), recall that each ωi can be represented as
Also,
and
Then
The representation (58) of r and s accounts for the fact that both r and s are smaller than pn. However, using (58), the product of r by s contains powers of p greater than pn, actually as high as p2·n−2.
In order to uncover the properties which relate the coefficients of (58), it is necessary to compute, and represent without loss of information, the multiples of any pi which results from the multiplication of r and s. To this end a new modulus is introduced, namely pM, where M>n. The use of M does not affect the magnitude of N. If N<pn, it can be represented as follows:
When M is employed in lieu of n, Ã should be computed as a solution of the following:
N≡A2 (mod pM). (60)
In the case where (59) is employed, reduction of (58) modulo p3 yields
Then, if the pair (ũ1, {tilde over (v)}2) is a solution of (61) modulo p, it is
The LHS of this congruence contains a contribution to the set of multiples of p3. This contribution is usually denoted as a “carry”. The flow of carries from one digit to the higher powers of p increases the complexity of the factorization problem. The flow of carries would be controlled better if (61) were solved modulo pM and the pair (u12, v2) were defined modulo pM−2. In this case (62) could take the following form:
This approach would require replacing the magnitude constraints (25) from the elements of {ui} and {vi} and assuring that the RHS of congruences such as (63) include all the terms which are multiples of any given pi. Following this procedure, still there would be carries, as shown on the LHS of (63). However, such carries would flow from any given congruence directly into a pool of multiples of pM.
In this approach, quantities such as Ã2−N are treated as polynomials in p, where the coefficients are integers unconstrained by (26) but instead subject to a different constraint such as (33).
Consider the representation of the pair (r, s) as in (58), where à is constructed as described above, and M is used in lieu of n. Thus, when r is multiplied by s, it is possible to group all the terms which contain any multiple of any given power of p, say pi, and place the condition that the sum of their coefficients be congruent to zero modulo pM−i.
However, resolving the integer Ã2−N into its components, the sum of the coefficients of pi in (Ã2−N) equals
(ni an integer).
As a result, consider the case when it is desired to express v6 as a function of all the ul (1≤l≤5) and the vj (2≤j≤5). It will be
−(2·{tilde over (ω)}0·v6+2·{tilde over (ω)}1·v5+2·{tilde over (ω)}2·v4+2·{tilde over (ω)}3·v3+2·{tilde over (ω)}4·v2)+2·v2·v4+v32≡2·u1·u5+2·u2·u4+u32 (mod pM−6). (65)
This congruence defines v6 modulo pM−6 as a function of lesser degree variables. If u1≢0 (mod p) and if all variables of lesser degree are known, (65) defines a linear congruence between v6 and u5 modulo pM−6. After determination of v6, upon multiplication by p6, it will be
where LH6 and RH6 denote the LHS and RHS of (65), respectively. The LHS of this latter congruence is a multiple of pM and does not contain any power of p greater than pM. In general, for 2≤i≤M−1,
The first summation on the LHS of (67) contains terms which result from the multiplication of −2·Ã by (Ã−Y), when à is represented as described in Section 7. The second summation on the LHS results from (Ã−Y)2.
In general, assume that uM−j=0 for 1≤j≤j0. Therefore, at this point, j0 is an undetermined integer. The pair (r, s) is dependent on the set {ui} and on the first elements of {vi}, for 2≤i≤j0+1. The general expression of (r, s) is
where
ζk={tilde over (ω)}k−vk−uk. (69)
To determine the first two coefficients of U, impose the condition that uM−1=0 and
ωi−ui−vi≡0 (mod pM−i)
for all i>2, also put ζ2=ω2−u2−v2. Then
Consider the case when it has been assumed that uM−1=0. It is desired to determine a pair of divisors (r, s) when uM−2≠0, if such a pair exists. In this case (68) can be written as follows:
where
Ã2={tilde over (ω)}0+{tilde over (ω)}1·p+{tilde over (ω)}2·p2 (71)
and
where
Ã1={tilde over (ω)}0+{tilde over (ω)}1·p (73)
and where ζ2 is defined as in (69):
Compare with (68) and (69).
Using (72), multiply r by s modulo pM. Setting the sum of the coefficients of any given power of p congruent to zero (mod pM−i) yields
Let RHi and LHi denote the RHS and the LHS, respectively, of that congruence in (75) which is defined modulo pM−i. Then, it must be
RHi−LHi≡0 (mod pM−i) (76)
Define
There is one condition which is not contained in (75): that is the condition that the sum of all multiples of pM in the system be equal to zero:
Refer to (72).
In this equation the integer uM−2 is defined modulo p2 by the second last congruence of (75). Also in the computation of CM−1, the integers uM−2 and uM−3 equal the corresponding values in the second last congruence of (75). The set of congruences (75) shall be referred as a supercongruence.
Consider the case when, given M, the system (75) has produced a set of viable pairs (u1, u2). In general, the majority of such pairs do not satisfy the conditions on the carries and cannot be considered as viable candidates.
Given a selection of u1, upon multiplication of r by s, the following relationships are applicable:
Given u1, this congruence produces v2 modulo pM−2. The last congruence makes use of the definition
ζ2≡{tilde over (ω)}2−v2−u2 (mod pM−2).
Given a selection of u2,
Given u2, this congruence produces v3 modulo pM−3. The last congruence makes use of the definition
ζ3≡{tilde over (ω)}3−v3−u3 (mod pM−3).
Given a selection of the auxiliary variable u3, let
v4≡2·ω0·ω4+2·ω1·ω3+ω22−2·u1·u3−u22−2·ω2·v2−2·ω1·v3+v22−2·ω0·v4 (mod pM−4)
Given u3, this congruence produces v4 modulo pM−4.
Multiplication of r by s produces
v5≡2·ω0·u5+2·(ω1−u1)·u4+2·ζ2·u3+2·ζ3·u2+2·ζ2·ζ3 (mod pM−5)
v6≡2·ω0·u6+2·(ω1−u1)·u5+2·ζ2·u4+2·ζ3·u3+ζ32 (mod pM−6)
For i>6, it will be
v7≡2·ω0·u7+2·(ω1−u1)·u6+2·ζ2·u5+2·ζ3·u4 (mod pM−7)
vi≡2·ω0·ui+2·(ω1−u1)·ui−1+2·ζ2·ui−2+2·ζ3·ui−3 (mod pM−i)
with, finally:
vM−3≡2·ω0·uM−3+2·(ω1−u1)·uM−4+2·ζ2·uM−5+2·ζ3·uM−6 (mod p3)
vM−2≡2·(ω1−u1)·uM−3+2·ζ2·uM−4+2·ζ3·uM−5 (mod p2)
vM−1≡2·ζ2·uM−3+2·ζ3·uM−4 (mod p)
IN SUMMARY, given (ui, u2) and the selection of u3, IF the pair (r, s) is represented as follows:
multiplication of r by s modulo pM yields:
For each initial selection of the pair (u1, u2), the system (80) may produce a quintuple (u1, u2, u3, ζ2, ζ3) such that r·s≡N (mod pM).
After the determination of the roster of candidates quintuples (ũ1, ũ2, ũ3, {tilde over (ζ)}2, {tilde over (ζ)}3), a similar procedure can be used to determine the roster {(u4, ζ4)}.
In this case, (68) yields:
To determine u4 (mod p), consider the raster of candidate triads (ũ1, ũ2, ũ3) which were already produced. Substitute ũ1, ũ2, and ũ3 into (81) in lieu of u1, u2, and u3, respectively, and search for an integer u4 modulo p which satisfies (81).
Consider the case when a candidate set (ũ1, {tilde over (ζ)}2, . . . , {tilde over (ζ)}j
Notice that in (68) the unknown variables are ζj
Proceeding as in (75) and (80), multiply r by s modulo pM and define the corresponding congruences modulo pM−i. The congruences which are defined modulo pM−2 through pM−j
The congruence modulo pM−j
In general, multiplication of r by s modulo pM using (68) yields
Note that uj
A set of coefficients (ũ1, ũ2, . . . , ũM−1) and ({tilde over (v)}2, {tilde over (v)}3, . . . , {tilde over (v)}M−1) is called a persistent solution if the first j0+1 of the ui satisfy the corresponding supercongruence (82).
The supercongruences can be clarified with the use of polynomials. The approach here shall be slightly more general than that taken previously.
This section shall make use of vectors of non-negative integers k=[k0, . . . , kM−1]. If k and k′ are two such vectors, then write k≤k′ if ki≤k′i for i=0, . . . , M−1. It is also occasionally convenient to regard k and k′ as zero-padded on the right, so that the comparison k≤k′ becomes meaningful even if k and k′ have different lengths.
A vector k=[k0, . . . , kM−1] is called monotone decreasing if k0≥k1≥ . . . ≥kM−1.
Definition 1. Let p be prime, M be a positive integer, and k=[k0, . . . , kM−1] be a vector of non-negative integers. A polynomial f(x)=f0+f1x+f2x2+ . . . +fM−1xM−1 is called pk-standard if
0≤fi<pk
for i=0,1, . . . ,M−1.
Definition 2. Let p, k be as in Definition 1. Let f(x)=f0+f1x+ . . . +fnxn be a polynomial with integer coefficients. The pk-standard part of f(x) is the polynomial
SPp
where, for 0≤i<M,
Note that if f is pk-standard, then it is pk′-standard for all k′≥k. When p and k are understood, SPp
Definition 3. If f and g are integer polynomials, then
f≡g (SPp
shall mean that
SPp
Digit expansions of positive integers:
Suppose the integer N is prepared as above, and N=v0+v1p+ . . . +vn−1pn−1 is the p-adic digit expansion of N. Then
v(x)=v0+v1x+ . . . +vn−1xn−1
is p1
Theorem 1. Given a non-negative integer N, there exists a unique 1n-standard polynomial v(x) such that v(p)=N.
The following recursive algorithm produces the coefficients of the polynomial v(x).
This algorithm terminates after [1+logpN] steps, and it is clear by induction that N=v(p). For uniqueness, if v and it are two standard polynomials such that v(p)=μ(p), say v(x)=a0+xv1(x) and μ(x)=b0+xμ1 (x), then v(p)≡μ(p) (mod p) implies that a0≡b0(mod p) and therefore a0=b0 since both are non-negative integers less than p. It then follows that v1(p)=μ1(p), which now implies uniqueness by induction on the degree.
Properties of the standard part
Proposition 1. f+g≡SPp
The following proposition motivates a choice of standard polynomials relevant to the supercongruences:
Proposition 2. Suppose that k=[M, M−1, . . . , 1]. If
f(x)≡g(x) (SPp
then
f(p)≡g(p) (mod pM).
In particular, this implies that if standard polynomials A, U, V are chosen such that
v(x)≡(A(x)−U(x)−V(x))(A(x)+U(x)−V(x)) (SPp
then the difference
(A(p)−U(p)−V(p))(A(p)−U(p)+V(p))−v(p)
is a multiple of pM, and represents the accumulated carry of the product, which for the purposes of factorization is desired to be zero. The advantage of this approach is that it allows the carry to be deferred to the final stage of the process.
Theorem 2. Let p be prime and k a nonempty vector of positive exponents. Suppose that f(x) is a pk-standard polynomial such that f(0)≢0 (mod p). Then there exists a unique pk-standard polynomial g(x) such that f(x)g(x)≢1 (SPp
Proof The theorem shall be established by first giving its iterative solution. Since f(0)≢0 (mod p), there exists an integer γ0 such that γ0f(0)≡1 (mod p). Let g0(x)=γ0 and, for j=0,1, . . . , define
gj+1(x)=SP((2−f(x)gj(x))gj(x)).
The iteration reaches a fixed point within ┌log2max(k0, k1+1, . . . , kM−1+M−1)┌ iterations. Indeed, define a norm on the set of integer polynomials via
|f|p=inf{p−r−s|r, sϵ, f≡O(xr) (mod p5)}.
Then, it shall be shown below that
|1−fgj+1|p≤|1−fgj|p2. (83)
The constant term of 1−fg0 is zero mod p: i.e., |1−fg0|<p−1. Consequently it follows by repeated squaring that |1−fgj|≤p−2
It remains to compute 1−fgj+1:
whence (83) by multiplicativity of the norm. □
Theorem 3. Let p be an odd prime and k a nonempty vector of positive exponents. If v(x) is an integer polynomial such that v(0)≡α2 (mod p), then there exists a unique standard polynomial A(x) such that:
A2(x)≡v(x) (SPp
and
A(0)≡α (mod p).
(This theorem implies in particular that, given {tilde over (ω)}0, there is a unique sequence {tilde over (ω)}1, {tilde over (ω)}2, . . . , {tilde over (ω)}M−1 such that (64) holds.)
Proof. By assumption, v(0) is a quadratic residue. Let α2≡v(0) (mod p). Define A0(x)=αand, for k=0,1, . . . , define
Ak+1(x)=2−1(Ak(x)+v(x)Ak(x)−1) (SP)
where at each stage of the iteration, the inverses are computed as in the previous section.
Consider the difference
Next, note that
Substituting into the above gives
and therefore, by multiplicativity of the norm from the proof of Theorem 2,
|v−Aj+12|p≤|v−Aj2|p2.
Hence,
Aj2≡v (SP)
as soon as 2j>max(k0, k1+1, . . . , kM−1+M−1).□
Let N be an integer prepared as in the previous section, and let v(x) be the polynomial obtained from the p-adic digit expansion of N Let A(x) be a standard polynomial such that
A2(x)≡v(x) (SPp
Definition 4. A standard polynomial factorization of v(x) is a pair of standard polynomials U(x), V(x) such that U(0)=V(0)=V′(0)=0 for which:
That is:
(A(x)+U(x)−V(x))(A(x)−U(x)−V(x))≡v(x) (SPp
The condition U(0)=0 shall be abbreviated U(x)=O(x), and the pair of conditions V(0)=V′(0)=0 shall be abbreviated V(x)=O(x2). Note polynomial factorization in the usual sense will not work: v(x) is very unlikely to factor completely, even if N is guaranteed to have factors. For example, with N=15, p=11, v(x)=2+91x+6x2 is irreducible, even though N=v(11)=15 has factors 3×5.
U(x) determines V(x) uniquely:
Theorem 4. Suppose A(x) is a standard polynomial such that A(x)2≡v(x) (SPp
Proof. Rearranging
(A+U−V)(A−U−V)−v=0
as a quadratic equation in V gives:
V2−2AV+(A2−U2−v)=0.
Let Δ(x)=U2(x)+v(x) be the quarter discriminant of the quadratic. Since U(0)=0 and v(0) is a quadratic residue modulo p, Δ(0) is also a quadratic residue modulo p, having square root ω0 mod p. Therefore by Theorem 3, there exists a unique standard polynomial √{square root over (Δ)}(x) with the property that √{square root over (Δ)}(0)≡ω0 (mod p) and
√{square root over (Δ)}(x)2≡Δ(x) (SP)
Note that
√{square root over (Δ)}(x)=A(x)+O(x2)
Therefore
V(x)=A(x)−√{square root over (Δ)}(x) (SPp
satisfies V(x)=O(x2).
For uniqueness, notice that the other candidate solution to the quadratic is
A(x)+√{square root over (Δ)}(x)≡2A(x)+O(x2) (SPp
has nonzero lower order terms in x. □
v(x)≡(A(x)+U(x)−V(x))(A(x)−U(x)−V(x)) (SPp
where U(0)=V(0)=V′(0)=0, define a polynomial ζ(x) by
ζ(x)=A(2)(x)−U(2)(x)−V(x),
where A(2)(x) and U(2)(x) are the quadratic Taylor remainders of A(x) and U(x):
A(2)(x)=A(x)−A1(x), U(2)(x)=U(x)−U1(x)
where A1 and U1 denote the linearizations of A an U, respectively:
A1(x)=A(0)+A′(0)x=ω0+ω1x
U1(x)=U′(0)x=u1x.
Plugging the definition of ζ(x) into the standard factorization problem
(A(x)+U(x)−V(x))(A(x)−U(x)−V(x))≡v(x) (SPp
gives
(A1(x)−U1(x)+2U(x)+ζ(x))(A1(x)−U1(x)+ζ(x))≡v(x) (SP) (85)
That is,
r(x)s(x)≡v(x) (SP)
where
Persistent factorizations
v(x)≡r(x)s(x) (SPp
is called persistent if, for all k′≥k, there exist k′-standard polynomials r′(x) and s′(x) having the same degree as r(x) and s(x), respectively, such that
r′(x)≡r(x) (SPp
s′(x)≡s(x) (SPp
v(x)≡r′(x)s′(x) (SPp
Persistent factorizations as lifts of factorizations mod p:
The following theorem allows polynomials U(x) and ζ(x) modulo p to be determined from a factorization modulo p of v(x). A standard polynomial factorization may then be obtained by applying a lift.
Theorem 5. Suppose that v(x)≡a(x)b(x) (mod p) where a, b are polynomials mod p, and a(0)≡b(0)≡ω0 (mod p). Then the polynomials
A1(x)=ω0+ω1x
ζ(x)=b(x)−b(0)−b′(0)x mod p
U(x)=(a(x)−b(x))/2 mod p
satisfy
A1(x)−u1x+2U(x)+ζ(x)=a(x)
A1(x)−u1x+ζ(x)=b(x),
where u1=U′(0). That is,
(A1(x)−u1x+2U(x)+ζ(x))(A1(x)−u1x+ζ(x))≡v(x) (mod p).
Proof. Write a(x)=ω0+a1x+a2x2+ . . . , b(x)=ω0+b1x+b2x2+ . . . Then since a(x)b(x)≡v(x)≡ω02+2ω0ω1x+O(x2) (mod p),
it follows that
2ω1=a1+b1
and so u1=(a1−b1)/2=ω1−b1 Now,
Also, since 2U(x)=a(x)−b(x),
as claimed.□
The final phase is concerned with an equation of the form
A2=T·N+correction
where the correction is a multiple of pM. That is
A2=T·N+k·pM
expresses A2 as the sum of a main term T·N and a correction k·pM. To analyze the correction term in more detail, a standard polynomial factorization yields a standard polynomial A(x) and a roster of pairs of standard polynomials (U(x), V(x)) such that
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))−v(x)≡0 (SPp
Consider the case where k=[M,M−1, . . . , 2,1]. Then, evaluating at x=p yields
(A(p)−U(p)−V(p))(A(p)+U(p)−V(p))≡v(p) (mod pM).
This equation implies that the difference
(A(p)−U(p)−V(p))(A(p)+U(p)−V(p))−v(p)
is a multiple of pM, which shall be thought of as a carry, comprised of the carries from the individual terms of the difference (A−U−V)(A+U−V)−v, and deferred to the final phase of the process.
In the carry phase, the roles of the correction term and main term are reversed. What was formerly the correction term, the “carry” −k·pM is now the main term. And what was formerly the main term T·N is now the correction.
Henceforth, set A=A(p), U=U(p), V=V(p) with U≡0 (mod p), V≡0 (mod p2), Let C be an integer for which (A−U−V)(A+U−V)−N≡C (mod V), which is to say that:
(A−U−V)(A+U−V)−N=BV+C
for some integers B and C. Assume that C does not share a factor with N. Regard the integer V as a parameter and consider the quadratic polynomial in V:
q(V)=(A−U−V)(A+U−V)−BV−C.
Note that q(V)≡0 (mod N0). The discriminant of this quadratic is
Δ=B2+4(U2+AB+C).
To facilitate the goal of factorization of q(V), it is desired to change parameters (U, V, C) such that the discriminant becomes a perfect square, because in this case Δ will factor over the integers.
A set of rescalings of the parameters is proposed that shall preserve the property of being a perfect square. Specifically, rescale U, V, C such that CU and UV remain constant. To this end, introduce free homogeneous parameters X0, X1 and:
Prolong by introducing a parameter X2 such that C2Δ=X22 (mod N), and X3 such that X0X3≡X12 (mod N). Then points [X0, X1, X2, X3] are desired such that the quadratic equations are satisfied:
A factor is found once one of the scaling parameters [X0, X1, X2, X3] has a non-trivial factor in common with N. Note that the first equation of (88) is a cylinder over a plane conic. The lines X0, X1, X3=constant are the reguli of the cylinder. An initial non-trivial point on the intersection is [X0, X1, X2, X3]=[1,0,CU,0].
The following operations are well-defined on the quartuples P: [X0, X1, X2, X3] satisfying (88), are defined:
The point [X0, X1, −X2, X3] is the other point on the quadric Q2 lying on the same regulus as P.
Given two points in general position P: [X0, X1, X2, X3], Q: [Y0, Y1, Y2, Y3], there is a third point R: [Z0, Z1, Z2, Z3] satisfying both (88) such that OPQR are coplanar, where O=[0,0,0,1].
Let a=(B2/4+AB) mod N0. Let [X0, X1, X2, X3] be coordinates of the first point and [Y0, Y1, Y2, Y3] coordinates of the second point, so the congruences hold:
X22≡X1X3+aX0X3+C2U2X02 (mod N0)
Y22≡Y1Y3+aY0Y3+C2U2Y02 (mod N0).
Then the coordinates of the third point [Z0, Z1, Z2, Z3] are determined mod N0 by:
The following theorem motivates this choice of polynomial transformation:
Theorem 6. Suppose that the points [X0: X1: X2: X3] and [Y0: Y1: Y2: Y3] obey (88). Then [Z0: Z1: Z2: Z3] given above also satisfies (88).
This can be proven by a brute-force calculation.
Similarly to how the integer factorization problem can be partially reformulated using standard polynomials, the treatment of the carries can be reformulated using polynomial operations. This reformulation has the advantage of being more general than the prior discussion.
Suppose that A(x) has been determined, and U(x) is a polynomial coming from a standard polynomial factorization of v. There is an associated polynomial V(x), such that
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (mod p).
The carry is the obstruction to factorization of N that comes when evaluated at x=p:
(A−U−V)(A+U−V)−N
where the notations are used A=A(p), U=U(p), V=V(p). One would like a way to manipulate this carry in order to guarantee a greater likelihood of factorization. To that end, let C be an integer for which (A−U−V)(A+U−V)−N≡C (mod V), which is to say that:
(A−U−V)(A+U−V)−N=BV+C
for some integer C. Assume that C does not share a factor with N. Replace the integer V by an indeterminate v, and then consider the quadratic polynomial in v:
q(v)=(A−U−v)(A+U−v)−Bv−C.
Note that q(V)≡0 (mod N). The constants A, U , B, C are regarded as parameters in this quadratic. In particular, its discriminant
Δ=B2+4(U2+AB+C)
depends on all four parameters. To change parameters to achieve a factorization, first rescale the parameters v, C, U, in such a way that Uv, UC, and v/C mod N0 remain constant (modulo N0). Consider therefore a residue x modulo N0, and rescalings of the form v→xv, C→xC mod N0, and U→x−1U where x−1 is computed modulo N0 so that xx−1≡1 (mod N0). (Assume that x has no factor in common with N0.) The new quadratic is thus
{tilde over (q)}(v)=(A−x−1U−xv)(A+x−1U−xv)−xBv−xC,
and the new discriminant modulo N0 is
{tilde over (Δ)}≡4Cx3+(B2+4AB)x2+4U2 (mod N0).
Now, it is desired that the discriminant becomes a perfect square modulo N0. That is, a solution is desired to
y2≡{tilde over (Δ)} (mod N0).
That is
y2≡4Cx3+(B2+4AB)x2+4U2 (mod N0).
Multiply both sides by C2/4 (mod N0):
Letting Y=Cy/2 and X=Cx, this equation becomes
Let f(X) denote the right-hand side of (89). Associate to any solution of (89) an affine-linear form ξ with the property that ξ(X)=0. The pair (ξ, Y) can be used in place of a solution (X, Y).
Note that ξ(X)=0, Y=CU is a solution. The following semigroup law takes a pair of solutions (ξ1, Y1) and (ξ2, Y2) and produces a third solution (ξ3, Y3).
To turn this into a factorization method, it is desirable to have versions of the polynomial extended Euclid algorithm (xgcd) and Chinese remainder theorem (crt) that return a factor if their inputs are degenerate modulo N0: i.e., if a factor is “discovered” by polynomial division.
In general, suppose that F is a (fixed) squarefree polynomial modulo N0 of even degree 2k≥4. Let ∂ be the set of polynomials (α(x), β(x), γ(x)) modulo N, where β is a monic polynomial, degα<degβ<k and
α(x)2≡F(x)+β(x)γ(x) (mod N0).
Define a binary operation ⊕ on δ as follows. Suppose given a pair X1=(α1, β1, γ1), X2=(α2, β2, γ2). Let δ be the greatest common divisor of β1, β2, and d the greatest common divisor of α1+α2, β1, β2. Let β3=β2/d2 mod N0. Then there exists a polynomial α3 of degree<degβ3 such that
α3≡α1 (mod β1/δ)
α3≡α2 (mod β2/δ)
F−α32≡0 (mod β3).
To determine this α3, there exist polynomials σ1 and and σ2 such that
σ1β1+σ2β2≡δ (mod N0)
and polynomials ρ and ϵ such that
ρδ+ϵ(α1+α2)≡d (mod N0).
Then
Next, put
While degβ3≥k, let
and
α3=−α3 (mod β3).
Finally make β3 monic by dividing by its leading coefficient. The binary operation ⊕ is thus defined as
X1⊕X2=X3
where
X3=(α3, β3, γ3).
Since N0 is assumed to be composite, the polynomial division operations (or the normalization of β3 in the last step) of the semigroup law may not be well defined. In that case, a factor of N0 shall have been discovered, and the process terminates.
Let N0=797×991=789827. Select the parameters p=13, M=4, and k=[1,1,1,1]. Note that N0 is a quadratic residue mod p, so that α=1 is a possible candidate α. Note that T=790087 is a prime greater than N0 such that N0≡Tα2 (mod p). Then, with N=TN0=624032044949, the digits of N modulo p form the polynomial:
v(x)=1+5x+5x2+6x3+9x4+7x5+12x6+12x7+10x8+6x9+4x10.
Modulo p=13, this polynomial factorizes as:
v(x)=(4)(x2+8)(x3+6x2+4x+1)(x5+2x4+11x3+7x2+11x+11).
The coefficients ω0, ω1, ω2, ω3 are determined so that
A(x)=ω0+ω1x+ω2x2+ω3x3
obeys
A(x)2≡v(x) (mod p, x4).
To begin the process, let ω0 be a root of ω02≡v0 (mod p), for instance ω0=1 satisfies 12≡1 (mod 13). The remaining coefficients wi must satisfy congruences
v1≡2ω0ω1 (mod p)
v2≡2ω0ω2+ω12 (mod p)
v3≡2ω0ω3+2ω1ω2 (mod p)
The first of these congruences reads
5≡2ω1 (mod 13)
and a solution of ω1=9 is found by modular inversion (2−1≡7 (mod 13)). The second congruence now reads
5≡2ω2+3 (mod 13)
giving ω2=1. The third congruence is now
6≡2ω3+18 (mod 13)
That is, 2ω3≡1 (mod 13), giving ω3=7. Thus the polynomial
A(x)=1+9x+x2+7x3
satisfies
A(x)2≡v(x) (SPp
With the trivial divisor of 1, the associated polynomial U is
The polynomial V is now determined from the data of v, A, U as
V=A±√{square root over (v+U2)} (SP)
where the square root is taken in pk-standard polynomials, and the sign is chosen so that the result is O(x2). Note that
v+U2≡1+5x+8x2+12x3 (SP).
Denoting √{square root over (v+U2)}=σ0+σ1x+σ2x2+σ3x3 (SP), the unknown coefficients σ0, σ1, σ2, σ3 must obey
1≡σ02 (mod p)
5≡2σ0σ1 (mod p)
8≡2σ0σ2+ν12 (mod p)
12≡2σ0σ3+2σ1σ2 (mod p)
where the integers on the left-hand side are the corresponding coefficients of the standard part of v+U2. Solving this system as above gives or σ0=ω0=1, σ1=ω1=9, σ2=9, σ3=3. Thus:
V=A−(1+9x+9x2+3x3)≡4x2+5x3 (mod 13).
In summary, the polynomials A, U, V are
A(x)=1+9x+x2+7x3
U(x)=4x+4x2+10x3
V(x)=4x2+5x3
Evaluating these polynomials at x=p gives integers
A(p)=15666, U(p)=22698, V(p)=9633
which are henceforth denoted A, U, V, respectively.
However, observe that the difference
(A−U−V)(A+U−V)−N=−624510847064
is not zero, nor do either r=A−U−V nor s=A+U−V share a nontrivial factor with N0. So, decompose the difference mod V:
−624510847064=(−64830359)V+1183.
This gives values for the parameters B=−64830359 and C=1183.
The objective is now to consider variables x such that the discriminant
is a perfect square modulo N0. To that end, let (ξ1, y1) be a pair comprising the monic affine -linear form ξ1 modulo N0 in one variable, and the integer y1 modulo N0, given by:
ξ1=x,
y1=CU mod N0=787443.
The pair (ξ1, y1) is the initial point for an iteration. The next point in the iteration (ξ2, y2) shall be determined as follows:
and y2=y2 mod ξ2. So ξ2=x+536317 and y2=2384.
To find the next point (ξn+1, yn+1) from the previous point (ξn, yn), the following procedure can be used.
Test if the greatest common divisor of the leading coefficient of ξn+1 and N0 is nontrivial: if so, then it means a factor is found. Otherwise, normalize ξn+1 by dividing (modulo N0) by its leading coefficient. Now update yn+1:
yn+1←−yn+1 mod ξn+1,
with the same meaning of mod.
To illustrate, to find (ξ3, y3) given the previously determined (ξ1, y1) and (ξ2, y2), note that ξ2−ξ1=536317, whose inverse modulo N0 is 114631. Let δ=1, σ1=−114631 and σ2=114631. Now, y2≡−y1 (mod N0), so let d=δ=1, ρ=1, ϵ=0. Let
and
after taking coefficients modulo N0 and obtaining the remainder from polynomial long division by ξ3. Because ξ3 is quadratic and not linear, replace it with
and update y3 via
y3←−y3 (mod ξ3)=52047.
The results of continuing this process for successive iterations is presented in Table 1. The final line gives y=704548. The gcd with N0 is then gcd(N0, y)=gcd(789827,704548)=797, and so a factor of N0 has been found. (The other factor can be obtained by division: N0/797=991.)
Consider the integer of 201 digits, composed of two large prime factors:
N0=22967931147801119577057392151555297515908528818203114721284113333931 69938767039237859844411753308995545617879257906080518909576843342909 2047830345207451926941075428246929075122113723634319517491078477.
Let p=1299721 and α=89. The integer
T=229679311478011195770573921515552975159085288182031147212841133339316 99387670392378598444117533089955456178792579060805189095768433429092 047830345207451926941075428246929075122113723634319517592414719
is a prime greater than N0 such that N0≡Tα2 (mod p). Then
v=1008831 +1136976x1+956702x2+288775x3+618031x4+786694x5++959534x6+982257x7+1079763x8+606595x9+1119948x10+315803x11++163055x12+277569x13+397201x14+845775x15+325656x16+401316x17++938657x18+445914x19+700279x20+1078663x21+1021990x22+267966x23++980433x24+864073x25+424418x26+501729x27+36106x28+24162x29++27979x30+250922x31+289611x32+1050104x33+1050583x34+442750x35++1280878x36+1072587x37+460680x38+1126283x39+679997x40+1014612x41++1071670x42+478751x43+479058x44+1180741x45+832872x46+508143x47++63586x48+170412x49+851654x50+673439x51+1294284x52+760587x53++906884x54+973676x55+50261x56+1032425x57+903379x58+1286973x59++180314x60+1066029x61+213083x62+1032351x63+1284994x64+20x65.
It is now desired to find integers ω0, ω1, . . . modulo p such that
With ω=649676, the unique integers ωi determined by these congruences are found in 1 millisecond on a single thread of an Intel(®) Core(™) i7-10700 CPU at 2.90 GHz, and are tabulated in Table 1, up to M=99.
The complete factorization of v(x) modulo p is determined using the procedure described in 2 milliseconds on a single thread of an Intel(®) Core(™) i7-10700 CPU at 2.90 GHz:
Up to a constant multiple, there are 24=16 divisors of the polynomial v(x) modulo p, and so 16 pairs of polynomials (U(x),V(x)) to inspect. Inspecting all of these, the procedure discovers a factor at
The entire procedure takes 5263 seconds on a Slurm cluster consisting of 4 PCs, each with 16 threads running on an Intel(®) Core(™) i7-10700 CPU at 2.90 GHz.
The extended Euclidean algorithm is an iteration of the division algorithm that allows one to compute s, t such that
sa+tb=gcd(a, b),
Inputs: Positive integers a and b.
Outputs: Integers s,t,d
sa+tb=d
where
d=inf{sa+tb|s,tϵ, sa+tb>0}
is the greatest common divisor of a and b.
Here is an implementation in Python:
Given a modulus M and integer a relatively prime to M, a modular inverse of a is an integer b such that ab≡1 (mod M). The Euclidean algorithm can be used to determine a modular inverse as follows. Since a and M are relatively prime, apply the Euclidean algorithm to find integers s, t such that
sa+tM=1.
Then, sa=1−tM implies sa≡1 (mod M). That is b=s is a modular inverse of a.
Suppose that N is an integer, possibly composite.
Inputs: Polynomials a and b modulo N.
Outputs: Integers s, t, d such that
sa+tb=d
where
degd=inf{deg(sa+tb)|s,tϵ, sa+tb≠0}
is the greatest common divisor of a and b, or else a nontrivial factor of N.
A version of the Chinese remainder theorem is needed that operates on polynomials modulo N, in the following sense. Suppose that x1 and x2 are two given polynomials modulo N and m1 and m2 are relatively prime, meaning that there exist u1 and u2 such that u1m1+u2m2≡1 (mod N). Then there exists a polynomial x such that x≡x2 (mod m1) and x≡x2 (mod m2), namely x=x1u2m2+x2u1m1. The polynomial x is unique modulo m1m2.
The following algorithm is sufficient to produce the required polynomial x, or else to produce a factor of N.
Suppose that p is prime and N, r are given integers. It is of interest to determine whether there is an integer s such that
N≡rs (mod pk). (90)
Basically one can perform ordinary digitwise long division to compute s mod pk for which this holds. Note that this can be done for any r that is not divisible by p, so that solutions of (90) do not confer anything about potential factors of N. More precisely:
Theorem 7. Let N be an integer. For any integer r not divisible by p, there exists for every positive k a unique integer s with 0≤S s<pk such that (90) holds. The solution s=sk to (90) depends only on the reduction of r modulo pk. Furthermore, when r is fixed, sk≡sl (mod pk) whenever k<l.
Proof. Since p is prime and r is not divisible by p, gcd(r, pk)=1 for all k≥0. From the division algorithm, there exist integers αk, βk such that
αkr+βkpk=1. (91)
Moreover, the residues αk (mod pk), βk (mod r) of a pair satisfying (91), are uniquely determined. Let s be the unique residue in 0≤s<pk such that Nαk≡s (mod pk). Then
rs≡N·(αkr)=N·(1−βkpk)=N−βkNpk≡N (mod pk).
This proves existence.
For the uniqueness of the residue sk (mod pk), suppose s, s′ both satisfy (90). Then rs≡rs′ (mod pk), or r·(s−s′)≡0 (mod pk). Since r is not divisible by p, this implies that pk|(s−s′). That is, s≡s′ (mod pk). The residue sk (mod pk) is thus unique.
Finally, since s=sk and s=sl both satisfy N≡rs (mod pk), it follows by uniqueness of the residue sk that sl≡sk mod pk. □
Corollary 1. Given the integers N and r as in Theorem 7, there exists a unique sequence of digits (a0, a1, . . . ) having the property that, for each k, N≡r·(a0+a1p+a2p2+ . . . +akpk) (mod pk+1).
One way to find the sequence ai is by “long division” of r into N, working from the lowest digits to the highest (unlike ordinary long division, which works from the most significant to least).
For example, long division of 137/352 in base p=5 returns the sequence of digits (up to the 18th digit);
1,1,3,4,4,4,2,2,1,4,1,2,4,0,1,1,4,3 . . .
That is,
This integer satisfies
352·s18≡137 (mod pk)
for k=1, 2, . . . , 18.
The long division can be prolonged to obtain more terms of the digit sequence. For example,
which satisfies
352·s24≡137 (mod pk)
for k=1,2, . . . ,24.
However, despite the fact that and 352·sk≡137 (mod 5k) for all k, and sk and sl will share the first k digits whenever l≥k, there is clearly no integer s that satisfies 352·s=137.
Consider an example where an integer N=rs has been prepared, say N=250641205046503. With p=29, one has
N=10+14p+11p2+4p3+14p4+24p5+0p6+1p7+8p8+17p9.
The goal of factorization is to find integers r, s>1 such that N=r·s. Assuming r is a candidate divisor, a possible s can be constructed using long division. For example, if a hypothesis is made that the first two digits of r are 12 and 6, that is r≡12+6p (mod p2). Then an s, should it exist, would be found by long division of r into N, tabulated in (92).
Note that there is no obstruction to performing the division out to this number of digits. Corollary 1 implies that “long division” can be carried out to arbitrarily many digits, so there will never be an obstruction. Information on whether r is a divisor of N must therefore come from a magnitude constraint: that is, is the resulting quotient s obtained by long division null-terminated? Since the product (25+12·p) (12+6·p) has fewer digits than N, no information is inferred on whether r could be a divisor of N from this division. It is necessary to consider more digits.
For example, hypothesizing that
r=12+6p+1p2+5p3,
then (93) tabulates the resulting long division.
Because the integer r·s is still not as long as N, it is required to specify still more digits. Since N has ten digits mod p, it will only be possible for r·s to have enough digits if at least six digits of r are known. For example, hypothesizing that
r=12+6p+1p2+5p3+23p4+26p5,
the answer is tabulated in (94).
Only now, in (94), does it become clear that there is no divisor r≡12 +6p+1p2+5p3+23p4+26p5 (mod p6), because the product of r and the digit sequence s resulting from long division (mod p6) has more digits than the integer N to be factored.
A seemingly plausible way to factor is to inspect all choices of digits in r, testing whether there is an s such that rs=N. Unfortunately, Corollary 1 implies that any selection of digits in r, provided the first digit is not zero, gives rise to a unique digit sequence s. This digit sequence corresponds to an integer if and only if it terminates. However, to check the termination condition requires to carry the long division out far enough. This example illustrates a general principle that no information on the feasibility of a factor r can be determined until about half the digits of N are specified. So searching over r and using long division is no better than brute force trial division,
Related to the problem of division modulo powers of p is that of inversion: given the digits of an integer a, to find a digit expansion x such that xa≡1 (mod pk). The following theorem characterizes the solutions to this problem. Later an algorithm shall be given for finding them.
Theorem 8. Let p be prime and a an integer not divisible by p. Then, for any positive integer k, there exists a unique integer xk between 0 and pk such that xka≡1 (mod pk). Furthermore, if k<l, then xl≡xk (mod pk).
Proof For uniqueness, suppose that two solutions xk and yk are given. Then:
(xk−yk)a≡0 (mod pk).
Since p is prime and does not divide a, it follows that pk|(xk−yk). That is, xk−yk≡0 (mod pk) or xk≡yk (mod pk). Because xk and yk are between 0 and pk by assumption, they must therefore be equal.
For existence, since a is prime to pk, the Euclidean algorithm gives integers s, t such that
sa+tpk=1.
Thus sa≡1 (mod pk), so setting xk=s mod pk gives the required (unique) solution. □
An alternative algorithm can be given that usually requires fewer divisions. Specifically, an iteration is given that computes x2
For j=0, the Euclidean algorithm is applied to obtain s, t such that sa+tp=1. Then take x1=s mod p, which then satisfies x1a≡1 (mod p). Next, supposing that x2
x2
Let |·|p denote the p-adic norm on the integers:
|n|p=inf{p−r|pr|n}.
Note that
|1−x1α|p≤p−1 (95)
because p divides 1−x1a. It shall be shown that
|1−x2
From (95) and (96) it follows by induction that
|1−x2
for all j; that is:
x2
as required.
It remains to show that (96) holds. Consider:
So (96) now follows by multiplicativity of the norm.
To summarize, the following algorithm can be used for inversion:
Inputs: A prime p, non-negative integer j, and integer a that is not divisible by p.
Output: An integer 0<x2
Let x←s mod p.
2. For j=1 to k, let x←(2−x*a)*x mod p2
3. Return x.
Here is an implementation:
Let N be a quadratic residue modulo p.
Theorem 9. Let p be an odd prime and N a positive integer not divisible by p. Suppose that 0≤A1<p satisfies A12≡N (mod p). Then, for any positive integer k there exists a unique integer Ak in 0≤Ak<pk such that Ak2≡N (mod pk) and Ak≡=A1 (mod p). Furthermore, if k<l, then Al≡Ak (mod pk).
Proof For uniqueness, if Ak, Bk are two solutions between 0 and pk, then
Ak2−Bk2=(Ak−Bk)(Ak+Bk)≡0 (mod pk).
Reducing modulo p, it follows that p divides Ak−Bk. If p were to also divide Ak+Bk, then p would divide Akand Bk, and therefore would also divide N (because Ak2≡N (mod p)). But this is contrary to the choice of N. Therefore, pk divides Ak−Bk. That is Ak≡Bk (mod pk). Since Ak and Bk are between 0 and pk by hypothesis, this implies Ak=Bk, and hence uniqueness. The last statement of the theorem is a consequence of the uniqueness, since Ak and Al satisfy Ak2≡N (mod pk) and Al2≡N (mod pk) implies that Al≡Ak (mod pk).
This leaves only the matter of existence. The solution Ak is computed as Ak=A2
A2
where the inverses are computed modulo p2
Note that |N−A12|p≤p−1. It will be shown that
|N−A2
so that, by induction,
|N−A2
i.e.,
A2
as desired.
To prove it, denote by 1/A2
Next, note that
Substituting into the above now gives
and therefore, by multiplicativity of the norm and since |A2
|N−A2
as required. □
The proof above contains the following algorithm, optimized to compute all of the required inverses together with the iterations.
Inputs: An odd prime p, integer N, integer A1 such that A12≡N (mod p), and a non -negative integer k.
Output: An integer A2
1. If k=0 then output A1 and exit. Else continue.
2. Let (s, t, 1) be the result of applying the Euclidean algorithm with inputs 2 and p, so that 2s+pt=1. Let s←mod p.
3. Let A←A1, q←p.
4. Let (u, v, 1) be the result of applying the Euclidean algorithm with inputs A1 and p, so that A1u+pv=1. Let u←u mod p.
5. For j=1 to k repeat:
6. Return A.
(Note the repeated step in the inner loop.)
Naturally an infinite digit expansion cannot be fully represented on a computer, so consider such digit expansions as a computation that can be continued indefinitely:
In representing an infinite digit expansion in computer memory, it is necessary to truncate it to some machine-sized limit. If such a cutoff is employed, it shall be chosen large enough not to interfere with any relevant features of the problem.
A digit expansion shall be a sequence of integers (x0, x1, . . . ) with 0≤x1<p, i=0,1, . . . Sequences can be subjected to the usual rules of addition-with-carry, multiplication-with -carry, subtraction-with-borrow, without regard for their size. Note that it is necessary to introduce some non-terminating sequences. For example, with p=5, the difference (3+5+52)−(1+2·5+52) can be found. After subtracting one from three without difficulty in the ones' place, it is now required to subtract two from one in the p's place, so a borrow of one. That leaves a deficit of one in the p2 place, so it is then necessary to borrow one from the next place, and so forth. Note that borrowing converts a 0 into p−1 (=4) plus a borrow from the next digit. Taken out to several digits, that is:
But clearly this process of borrowing from 0 can be continued indefinitely, and the outcome of this computation is the non-terminating sequence (2,4,4,4,4, . . . ). It is also instructive to reverse the process, adding (1,2,1) to (2,4,4,4, . . . ):
All of the borrows are now carries: whenever a 1 overflows into a 4, it gives zero with a carry of one to the next 4 in the chain, and so on ad infinitum.
It is convenient to identify the sequence (x0, x1, . . . ) with a formal sum of powers of p,
Then the arithmetic operations have their usual meanings, with carry, on infinite expressions.
Explicitly, suppose
Then the following rules hold:
where for n=0,1, . . . ,
zn=(xn+yn+cn) mod p,
cn+1=└(xn+yn+cn)/p┘
and c0=0.
where for n=0,1, . . . ,
zn=(xn−yn+cn) mod p,
cn+1=└(xn−yn+cn)/p┘
and c0=0.
where for n=0,1, . . . ,
and c0=0.
Theorem 9 can be reformulated using infinite digit expansions:
Theorem 10. Let p be an odd prime and N a positive integer not divisible by p. Suppose that 0≤a0<p satisfies a02≡N (mod p). Then there exists a unique digit expansion A=(a0, a1, . . . ) such that A2=N.
Every quadratic residue has a square root.
Clearly not every quadratic residue is a perfect square. For example, the integer 6 is a quadratic residue modulo 5, but is plainly not a perfect square.
However, because of Theorem 10, any integer N that is a quadratic residue modulo p is a “perfect square” in the sense that there exists a digit expansion A such that N=A2. Clearly such a digit expansion A must be infinite, unless N is a perfect square in the usual sense, as the example N=6, p=5 shows.
Because of Theorem 10, it is possible to solve the equation N=r·s, with the constraint that r and s have the same digits as one another (i.e., s=r). So although N has a “factorization” N=r·s where r and s are the same digit sequence, this common digit sequence does not terminate (unless N is a perfect square, which it is not in these applications). The algorithm described in conjunction with Theorem 9 supplies a rule for producing as many digits of the expansion A as desired.
In the example of 6 modulo 5, if A denotes the infinite digit expansion
A=1+3·5+0·52+4·53+2·54+1·55+2·56+3·57+1·58+3·59+ . . .
then
A21+1·5+0·52+0·53+0·54+0·55+0·56+0·57+0·58+0.·59+ . . .
i.e., one has
A2=6
even though obviously no integer has this property.
Definition 7. Let A, B, M be integers. The notation
A≡B (mod M)
means that there exists an integer k such that
A=B+kM.
Here are properties of integer congruences:
Proposition 4. Let M be a positive integer. Then, for each integer A, there exists a unique integer r with 0≤r<M, such that A≡r (mod M).
Proof Recall that Euclidean division guarantees that there exist unique integers q and r, the quotient and remainder upon division of A by M , such that A=qM+r where the remainder satisfies 0>r<M. □
Theorem 11. If A and M are coprime integers, then, for any integer B, there exists an integer x such that Ax≡B (mod M). Moreover, there is a unique x in the interval 0≤x<M, and any two solutions differ by a multiple of M.
The uniqueness is of special importance here because of the fact that it is usually simpler to check whether an integer x satisfies Ax≡B (mod M) than it is to construct a solution. In cases where such solutions are desired, it is sufficient to check explicitly that the solution is correct: the details of the applications of the Euclidean division required to produce the solution in the first place can be omitted.
Proof The following lemma holds: the greatest common divisor of A and M is the least positive integer of the form sA+tM for integers s, t. To prove the lemma, let d=sA+tM be the least such positive integer. Since any common divisor of A and M divides d, it follows that gcd(A, M)|d. To show the opposite, that d divides A and M, and it is sufficient by symmetry to show that it divides A. Recall that if q and r are the quotient and remainder of division of A by d, then
A=qd+r
where 0≤r<d. To show that r=0, were it not the case, then note that r=A−qd=A−q(sA+tM)=(1−qs)A+(−qt)M is a positive integer of the form s′A+t′M that is less than d. But d was supposed to be the least such positive integer, so this contradicts the choice of d. Thus it has been shown that d|A. Since also then d|M by symmetry, it now follows that d|gcd(A, M) and now it is proven these positive integers divide one another and thus they are equal.
Returning to the proof of the theorem, since A, M are coprime, there are integers s and t such that As+Mt=1. Multiplying by B this is A(Bs)+M(Bt)=B so that A(Bs)≡B (mod M). Thus x=Bs is the required solution.
For uniqueness, suppose two solutions x, x′ are given, with 0≤x, x′<M, then A(x−x′)≡0 (mod M). Since A has no divisors in common with M, this implies that |x−x′| is divisible by M and the only integer in the interval 0≤|x−x′|<M with this property is |x−x′|=0, so x=x′. This completes the proof. □
The systems of congruence employed here have the following form where p is a prime and the exponents ki are positive integers:
The following corollary to Proposition 3 holds:
Proposition 5. Suppose that the pairs of integers (Ai, Bi) satisfy the system (98) and ki′ are any positive integers such that ki′≤ki for 1≤i≤m. Then for any integer pairs (Ai′, Bi′) such that
Ai′≡Ai (mod pk
Bi′≡Bi (mod pk
for 1≤i≤m, the system of congruences (99) also holds:
This proposition facilitates checking certain systems of congruences by hand.
When a system of congruences (99) is obtained from (98) as in Proposition 5, the system of congruences (99) arises from (98) by truncation. Proposition 5 implies that every solution to a system of congruence is also a solution to its truncation.
The converse is not true. However, the following principle does hold: every solution to a truncated system of non-degenerate polynomial congruences can be prolonged to a solution of the original system.
In more detail,
Theorem 12. Let F1(X1, . . . , Xn), . . . , Fn(X1, . . . , Xn) be integer polynomials in the indeterminates X1, . . . , Xn. For any solution any positive integers k1, . . . , k1, and for every solution (X1*, X2*, . . . , Xn*) modulo p to the system of congruences
such that the determinant of the matrix of partial derivatives (∂Fi/∂Xj)(X1*, . . . , Xn*) is not divisible by p. Then there exists a unique solution (X1′, . . . , Xn′) of
such that (X1′, . . . , Xn′) modulo p is congruent to (X1*, . . . , Xn*).
Proof Let X=(X1, . . . , Xn) and DF(X) be the matrix of partial derivatives of F. If Σ is any n -dimensional vector of integers, then
F(X*+pΣ)=F(X*)+pDF(X*)·Σ (mod p2). (100)
Since F(X*)≡0 (mod p), all components of the vector F(X*) are divisible by p, and so the following definition is allowed:
Σ=−DF(X*)−1 (F(X*)/p)
where the inverse matrix DF(X*)−1 is computed modulo p (by hypothesis, it is invertible).
Then (100) implies that F(X*+pΣ)≡0 (mod p2). Now iterate this construction with p2 instead of p, and so on. The iteration is none other than Newton's method:
Xn+1=Xn−DF(Xn)−1F(Xn)
and the same argument shows by induction that F(xn+1)≡0 (mod p2
For uniqueness, it is sufficient to exhibit a metric space for which the iteration Φ(X)=X−DF(X)−1F(X) is strictly contractive. To this end, let p denote the p-adic integers and extend Φ by density onto pn, where pn is given the finite-dimensional l∞ metric. Then:
To prove it, suppose F(X),F(Y)≡0 (mod p). Denote by A the linear form such that DF(Y)−1=DF(X)−1+A(Y−X)+o(|Y−X|∞). Note that A is an integral form (i.e., has entries in p), because of the hypothesis on the determinant of DF(X). Then
Since F(X)≡0 (mod p), it then follows that |Φ(Y)−Φ(X)|≤p−1|Y−X|. Thus Φ is a strict contraction on a closed subset of a complete metric space, and therefore has a unique fixed point. □
Note that the proof of the theorem also contains an effective method for constructing the lifted solution (Newton's method).
A system of polynomials F1(X1), F2(X1, X2), . . . , Fn(X1, . . . , Xn), where the k-th polynomial of the system depends only on the first k variables, is called lower triangular. It is easier to formulate uniqueness for lower-triangular systems, and these are the only kinds of systems that shall be considered henceforth.
Theorem 13. Suppose that F1(X1), F2(X1, X2), . . . , Fn(X1, X2, . . . , Xn) is a lower-triangular system such that the diagonal partial derivatives ∞F1, ∞X1, ∞F2/∞X2, . . . , ∞Fn/∞Xn are non-zero constants modulo p. Then for any positive integers ki, there exists a unique solution to the system
such that 0≤Xi<pk
Proof. The proof is by induction on the number of equations. The condition on ∞F1/ ∞X1 implies that F1 has the following form
F1(X1)=a1X1+b1+pR1(X1)
where R1 (X1) is an integral polynomial. By hypothesis, a1 is not zero modulo p, and so a1X1+b1≡0 (mod p) has a unique solution modulo p. Theorem 12 implies the uniqueness of the lift.
Assuming the theorem has been established for a lower triangular system F1(X1), . . . , Fn (X1, . . . , Xn) it is now sufficient to show how to prove it when there is one more relation Fn+1(X1, . . . , Xn+1). As in the n=1 case, the hypothesis implies
Fn+1(X1, . . . , Xn+1)=an+1Xn+1+bn+1+pRn+1(X1, . . . , Xn+1))
where an+1 is a nonzero constant and bn+1 is a polynomial in (X1, . . . , Xn), which have already been determined and so can be eliminated. Because an+1Xn+1+bn+1≡0 (mod p) has a unique solution for Xn+1, it therefore follows, again by Theorem 12, that the equation an+1Xn+1+bn+1+pRn+1≡0 (mod pk
Suppose that f(x) is a polynomial of degree d≥1 modulo pM where p is prime and M≥1. Factorization of f has two phases. The second phase is known as Hensel lifting: given any factorization of f(x) modulo p, say f(x)≡f1(x)f2(x) . . . fr(x) (mod p), there exists a unique factorization of f(x) modulo pM, f(x)≡
Factorization modulo an odd prime p is achieved with the following algorithm.
A monic polynomial f(x) of degree d≥1, modulo an odd prime p.
A set of pairs {(fi(x), ei)} of monic polynomials fi(x) that are irreducible mod p, and multiplicities ei, for 1≥i≥r, such that f(x)≡f1(x)e
Then set
g←gcd(h−x, ϕ)
4. If g≠1, then call the equal-degree factorization subroutine, with input g and i, and keep the list of irreducible factors g1, . . . , gs of g.
The following subroutine is used in the main algorithm.
A square-free monic polynomial f modulo p of degree n>0, and a divisor d<n of n, such that all irreducible factors of f have degree d.
The monic irreducible factors f mod p.
Recall Hensel's lemma:
Theorem 14. Let p be a prime and f(x) be an integer polynomial admitting a factorization f(x)≡a(x)b(x) (mod p). Then, for any M≥1, there exist unique (p,M)-standard polynomials ã(x), {tilde over (b)}(x) with ã(x)≡a(x) (mod p) and
The polynomials ã(x) and {tilde over (b)}(x) are called the lifts of the factors a(x) and b(x).
A corollary in the present application is:
For a factorization f=gh into a pair of factors, the lift is constructed using the following recursive procedure.
Inputs: A p-adic polynomial f and p-adic polynomials gk, hk, sk, tk such that
f≡gkhk (mod p2
skgk+tkhk≡1 (mod p2
Outputs: p-adic polynomials gk+1, hk+1, sk+1, tk+1 such that
f≡gkhk (mod p2
skgk+tkhk≡1 (mod p2
To lift several factors, one employs a divide and conquer approach. Given a (pairwise coprime) factorization of f=g1g2 . . . gr:
Let p be an odd prime and consider polynomials v(x)=α0+α1x+ . . . +αnxn where the coefficients are integers 0≤αi<p for each i. The usual rules for polynomial arithmetic are observed, but the coefficients are reduced modulo p. The rules for arithmetic are then extended to power series modulo p. Operating on sequences, the rules are the same as those of digit sequences except that the carry is discarded. Thus the arithmetic of power series modulo p is arithmetic without carry.
Theorem 15. Let f(x) be a polynomial modulo p and suppose that p does not divide f(0). Then there exists a unique power series g(x) such that f(x)g(x)≡1 (mod p).
Proof. For uniqueness, if there were two solutions g and g′, then f(x)(g(x)−g′(x))≡0 (mod p) implies that g(x)−g′(x)≡0 (mod p) and so the polynomials g(x) and g′(x) are the same modulo p.
For existence, it will suffice to give an efficient algorithm for constructing the inverse. Since p does not divide f(0), the Euclidean algorithm gives a coefficient g0 modulo p such that
f(0)g0≡1 (mod p).
Then, for k=0,1, . . . , define
gk+1=(2−gkf)gk mod p2
Let |·| denote the x-adic norm on the power series:
|g(x)|=inf{2−k|xk|g(x)}.
Note that
|1−g0f|≤2−1 (101)
because x divides 1−g0f. It is now shown that also
|1−gk+1f|≤|1−gkf|2. (102)
From (101) and (102) it follows by induction that
|1−gkf|≤2−2
for all j; that is:
gkf≡1 (mod x2
Also, if k<k′, |gk−gk′|<2−2
It remains to show that (102) holds. Consider
So (102) now follows by multiplicativity of the norm.□
Theorem 16. Suppose that v(x) is a polynomial modulo p such that v(0) is a quadratic residue modulo p, say α2≡v(0) (mod p). Then there exists a unique power series A(x) mod p such that A(x)2≡v(x) (mod p) and A(0)≡α (mod p).
Proof. For uniqueness, if A, B are two solutions, then
A2−B2=(A−B)(A+B)≡0 (mod p).
Thus p divides either A−B or A+B, meaning that A≡±B (mod p). Hence, only one of A, B can satisfy A≡α (mod p). Therefore the solution is unique.
This leaves only the matter of existence. Define a sequence A0, A1, . . . by A0=α, and
Ak+1=2−1 (Ak+vAk−1) mod x2
where the inverses are computed modulo x2
Note that |v−A02|≤2−1. It shall be shown that
|v−Ak+12|=|v−Ak|2
so that, by induction,
|v−Ak2|p=2−2
i.e.,
Ak2≡v (mod x2
as desired.
To prove it, denote by 1/Ak the inverse of Ak modulo x2
Next, note that
Substituting into the above now gives
and therefore, by multiplicativity of the norm and since |Ak|=1,
|v−Ak+12|=|v−Ak2|2,
as required. □
The present invention pertains to a method for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers. See
otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
There may be the step of displaying on a display the decrypted signal W. The display may be any type of computer display, tablet display, telephone display or paper which allows the decrypted signal W to be read by a person.
There may be the steps of, if a factorization of N0 is not found after a preselected amount of time, re-initializing the semigroup law with different values of a and b; and repeating the electing, applying, determining, testing and Identifying steps until a factor with N0 is found.
There may be the second computer generated steps of selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There may be the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There may be the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p.
There may be the second computer generated steps of for each item of the roster, a standard polynomial factorization is
v(x)≡(A(x)−U(x)−V(x))(A(x)+U(x)−V(x)) (SP)
determining a carry by
(A(p)−U(p)−V(p))(A(p)+U(p)−V(p))−v(p)≡BV(p)+C
which defines constants B and C for each pair of the roster, for those elements of the roster of (U(x), V(x)) such that both corresponding constants B, C are simultaneously zero, the integers r(p)=A(p)−U(p)−V(p) and s(p)=A(p)+U(p)−V(p) contain divisors of N0. There may be the step of extracting the divisors to obtain the prime factors of N0.
The present invention pertains to a second computer for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s, as shown in
otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. The cpu decrypting the signal W with the public key N0 and prime factors of integer N0. The cpu reviewing the decrypted signal W for predetermined words to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be quickly acted upon to eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated. The steps described above for the method are also applicable to the second computer.
The present invention pertains to a non-transitory readable storage medium which includes a computer program stored on the storage medium for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s, where the signal W has been stored in a second non-transient memory of a second computer, and the second computer factoring the public key N0 in time O(log6N0). The signal W obtained from a telecommunications network, or a data network or an Internet or a first non-transient memory. The computer program having the second computer generated steps of selecting integers a, b. There is the step of electing an initial point in a set of quartuples of integers modulo N0 (a projective space) [X0, X1, X2, X3]=[1,0,b,0]. There is the step of applying a semigroup law repeatedly starting from the initial point, where the semigroup law is defined as: given a pair of elements [X0: X1: X2: X3] and [Y0: Y1: Y2: Y3] of the projective space, there is produced a third point [Z0, Z1, Z2, Z3]. There is the step of determining that [X0: X1: X2: X3]≡[Y0: Y1: Y2: Y3] (mod N0), and thus the third point is
otherwise, the point [Z0, Z1, Z2, Z3] is:
There is the step of testing if any component of the third point shares a factor with N0 and is a shared factor with N0. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated. The steps described above for the method are also applicable for the computer program.
Alternatively, the present invention pertains to a method for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers. The method comprises the steps of obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non -transient memory. There is the step of storing the signal W in a second non-transient memory. There is the step of decoding with a second computer in communication with the second non-transient memory the signal W in the second non-transient memory by factoring the public key N0 in at most a time O(log6N0) with the second computer generated steps of selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated.
There may be the second computer generated steps of, for each item of the roster, a standard polynomial factorization is
v(x)≡(A(x)−U(x)−V(x))(A(x)+U(x)−V(x)) (SP)
then determining a carry by
(A(p)−U(p)−V(p))(A(p)+U(p)−V(p))−v(p)=BV(p)+C
which defines constants B and C for each pair of the roster, for those elements of the roster of (U(x), V(x)) such that both corresponding constants B, C are simultaneously zero, the integers r(p)=A(p)−U(p)−V(p) and s(p)=A(p) +U(p)−V(p) contain divisors of N0. There may be the step of extracting the divisors to obtain the prime factors of N0.
There may be the second computer generated steps of given the initial pair ξ1=0, y1=CU(p) mod N0, calculating a discriminant Δ from
There may be the step of iterating a semigroup law until a factor is found, where the semigroup law is defined as:
If ξn≡ξ1 (mod N0), let δ=ξ1, σ1=0, σn=1, otherwise, ξn . . . ξ1 is a nonzero constant modulo N0; checking whether ξn−ξ1 shares a factor with N0; if so, then terminating the semigroup iteration and the factor identified is one of the prime factors of N0, where the other prime factor is found by division of N0 by the first factor; let δ=1, λ=(ξn−ξ1)−1 (mod N0), σ1=−λ, σ2=λ; so irrespective of whether ξn≡ξ1 (mod N0), it holds that σ1ξ1+σnξn=δ where δ is a polynomial gcd of ξ1 and ξn;
Next, if yn≡−y1 (mod N0), then let d=δ, ρ=1, ϵ=0; else, checking if yn+y1 shares a factor with N0 and if so then terminating the semigroup iteration and the first factor identified as one of the prime factors of N0, where the other prime factor is found by division of N0 by the first factor; otherwise, let d=1, ρ=0, and λ=(yn+y1)−1 mod N0, so that for either sign in yn≡±y1 (mod N0), a congruence ρδ+ϵ(y1+yn)≡d (mod N0) now holds, where d is a polynomial gcd of δ and y1+yn;
Finally, let ξn+1←ξnξ1/d2, define yn+1 (mod N0) such that the congruence holds:
dyn+1≡ρ(σ1ξ1yn+σnξny1)+ϵδ(mod ξn+1)
where the modulo is with respect to polynomial division by ξn+1 (mod N0), and, if ξn+1 is quadratic rather than linear, then let
There may then be the step of testing whether the leading coefficient of ξn+1 and N0 share a factor, and if so, then terminating the semigroup iteration and the first factor is found by division of N0 by the first factor; else, normalize ξn+1 by dividing (modulo N0) by the leading coefficient of ξn+1 and update yn+1:
yn+1←−yn+1 mod ξn+1.
There may be the step of iterating the semigroup law until a prime factor is found. There may be the step of identifying this prime factor as the first factor of N0. There may be the step of obtaining the other prime factor by division of N0 by the first prime factor.
The present invention pertains to a second computer for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s. The second computer comprises an input for obtaining the electromagnetic signal W from a telecommunications network, or a data network or an Internet or a first non-transient memory. The second computer comprises a second non-transient memory in communication with the input in which the signal W is stored. The second computer comprises a cpu in communication with the second non -transient memory with the signal W in the second non-transient memory. The cpu decodes the signal W by factoring the public key N0 in time O(log6N0) by the second computer generated steps of selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ , , , +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. The cpu decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. The cpu reviewing the decrypted signal W for predetermined words to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated. The steps described above for the alternative method are also applicable for the second computer.
The present invention pertains to a non-transitory readable storage medium which includes a computer program stored on the storage medium for decoding an encrypted electromagnetic signal W encoded by a first computer with public key N0=r×s, where N0, r and s are integers and W is a function of r and s, where the signal W has been stored in a second non-transient memory of a second computer, and the second computer factoring the public key N0 in at most a time O(log6N0). The signal W obtained from a telecommunications network, or a data network or an Internet or a first non-transient memory. The computer program having the second computer generated steps of: selecting a prime p and vector of positive integers k=[k0, k1, . . . , kM−1]. There is the step of determining a polynomial v(x)=v0+v1x+ . . . +vn−1xn−1 such that v(p)=N is a predetermined multiple of N0. There is the step of determining a pk-standard polynomial A(x) such that A(x)2≡v(x) (SPp
0≤fi<pk
for i=0,1, . . . ,M−1, a pk-standard part of the polynomial f(x) is computed by reducing the coefficient of xi modulo pk
(A(x)−U(x)−V(x))(A(x)+U(x)−V(x))≡v(x) (SPp
where a standard polynomial factorization v(x)≡r(x)s(x) is called persistent if r(x) and s(x) have the same degree as their reductions modulo p. There is the step of determining a shared factor that integers r(p) and s(p) share with N0, where the shared factor with N0 as one of plurality of prime factors of N0. There is the step of obtaining another prime factor by division of N0 by the shared factor. There is the step of identifying the shared factor with N0 as one of plurality of prime factors of N0, and a quotient of N0 by the shared factor as another prime factor. There is the step of decrypting with the second computer the signal W with the public key N0 and prime factors of the integer N0. There is the step of reviewing the decrypted signal W for predetermined words with the second computer to determine if the decrypted signal W indicates an act has occurred or will occur that violates a law, or will violate a law, wherein the signal W representative of the message is effectively decrypted and deciphered thereby a threat to property or individuals in violation of the law can be acted upon to mitigate or eliminate the threat before the threat occurs and actual damage to property or injury to individuals is prevented or mitigated. The steps described above for the alternative method are also applicable for the computer program.
Although the invention has been described in detail in the foregoing embodiments for the purpose of illustration, it is to be understood that such detail is solely for that purpose and that variations can be made therein by those skilled in the art without departing from the spirit and scope of the invention except as it may be described by the following claims.
Number | Name | Date | Kind |
---|---|---|---|
20130136257 | You | May 2013 | A1 |
20180198613 | Anderson | Jul 2018 | A1 |