Last active
September 5, 2023 19:33
-
-
Save Hermann-SW/50514eaf06b4d91ec6bcee5e49732dff to your computer and use it in GitHub Desktop.
PARI/GP test script wrt kronecker(), chinese(), and prime factors of rsa numbers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\r RSA_numbers_factored.gp | |
test(v)= | |
{ | |
if(#v<4, | |
break()); | |
my([l,n,p,q]=v,pnr,qnr,sqrtm1); | |
if ((p%4!=1)||(q%4!=1), | |
break()); | |
forprime(t=2,oo, | |
if(kronecker(t,p)==-1, | |
pnr=t;break())); | |
forprime(t=2,oo, | |
if(kronecker(t,q)==-1, | |
qnr=t;break())); | |
sqrtm1=chinese(Mod(pnr,p)^((p-1)/4),Mod(qnr,q)^((q-1)/4)); | |
print(l," ",centerlift(sqrtm1^2)); | |
}; | |
{ | |
foreach(rsa,v, | |
test(v)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://pari.math.u-bordeaux.fr/archives/pari-users-2309/msg00000.html
Uses this repo:
https://github.com/Hermann-SW/RSA_numbers_factored