![]() |
|
|
#1 |
|
Mar 2017
2·3·5 Posts |
Is there any screening/probabilistic test to speed up the determination of whether a given value x is a square root of 1 mod N, other than just doing the \(x^2\mod N\) expansion explicitly? x and N are bigints of thousands or more bits, so that multiplication can be expensive.
Certainly there's a couple trivial pretests.. we can test if x=1 or N-1 and return true if it is. We can then follow up with a test if \(x<\sqrt N\) which is also nearly free since we can just compare the binary bit counts of x compared to N, and return false if x is too small. I can't think of any other shortcuts beyond this. Last fiddled with by mathPuzzles on 2017-06-26 at 10:04 |
|
|
|
|
|
#2 |
|
Aug 2002
Buenos Aires, Argentina
2·683 Posts |
If you know that N is prime, checking that x=1 or x=N-1 is enough. You cannot find other value of x such that x2 = 1 (mod N).
If N is composite and you know the prime factors pi of N, you can check whether x = 1 or x = pi-1 (mod pi) for all values of i. If the congruence does not hold for some value of i, that means that x2 is not 1 (mod N). |
|
|
|
|
|
#3 | |
|
Feb 2017
Nowhere
4,643 Posts |
Quote:
gcd(x - 1, N) and gcd(x + 1, N) should produce a proper factorization of N... |
|
|
|
|
|
|
#4 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
Is not always true... example N=9 and x=8, 8 is -1 mod 9; 8^2 is 1 mod 9; gcd(8+1,9)==9; gcd(8-1,9)==1 .You don't get anything about 3 being a factor, so in theory you could conclude 9 is prime. Same thing happens, with x=14 and N=15 x-1 is prime so gcd(x-1,N)==1 and x+1 is N. okay didn't see the not equal sign for some reason. at least this post shows why the not equals sign is there.
Last fiddled with by science_man_88 on 2017-06-27 at 14:06 |
|
|
|
|
|
#5 |
|
Aug 2006
3·1,993 Posts |
|
|
|
|
|
|
#6 |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
3·5·137 Posts |
Stating the obvious in case it is of any use.
N=x^2-1 -> x-1 | N Or more generally N=x^m - y^m -> x-y | N -------- N=x^2+1 -> x+i | N Or more generally N=x^m + y^m -> x+y | N for all positive odd integers m |
|
|
|
|
|
#7 |
|
"Forget I exist"
Jul 2009
Dumbassville
20C016 Posts |
|
|
|
|
|
|
#8 | |
|
Mar 2017
368 Posts |
Quote:
For random N, this will indeed be a fast rejection for the majority of cases without ever having to do the expensive full multiplication. |
|
|
|
|
|
|
#9 |
|
Aug 2002
Buenos Aires, Argentina
55616 Posts |
There is an optimum bound depending on the size of N. If N is very high (several thousands of bits), you can increase the bound.
If N has only 100 bits, you will need to reduce the bound, otherwise it will be cheaper to compute x2 mod N than the multiple one-limb divisions. Last fiddled with by alpertron on 2017-06-28 at 12:34 |
|
|
|
|
|
#10 |
|
Romulan Interpreter
Jun 2011
Thailand
7·1,373 Posts |
There is no known way to test faster a much-much-much weaker condition: the fact that x^2=a^2 (mod n), for which your question is a particular case* of a particular case**. If you would be able to do that, than you could efficiently factor n, because x^2-a^2=0 (mod n) and you could take gcd between n and either x+a or x-a.
-------------- *(where you do not take the modulus) **(a=1) Last fiddled with by LaurV on 2017-07-01 at 03:59 |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem detecting GPU | VoltsNCodes | Msieve | 13 | 2013-06-14 15:14 |
| Msieve not detecting L3 cache | 10metreh | Msieve | 8 | 2010-10-26 01:42 |
| Perl help with bigint | kuratkull | Programming | 28 | 2007-04-30 14:14 |
| Detecting arithmetic progressions | grandpascorpion | Math | 18 | 2007-03-28 15:08 |
| Bigint problem with snfs latest snapshot | VJS | Factoring | 0 | 2006-07-10 22:25 |