Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-11-09 14:05:01 +01:00
parent d2816f13ea
commit 00225c1d54
Signed by: y0rune
GPG Key ID: F204C385F57EB348
1 changed files with 9 additions and 9 deletions

View File

@ -113,20 +113,20 @@ def primalityTest(n)
return true
end
counter = rand(n/2..n)
counter = rand(3..n)
while (counter != 0) do
b = rand(2..n)
b = rand(2..n-2) # Tez dziala n-1
if betterExponentiation(b,n-1,n) != 1 then
return false
end
counter = counter + 1
counter = counter - 1
end
return true
end
#1 #puts random_gen_Zn(50,3)
#2 #puts reciprocal_Phi_p(5,7)
#3 #puts betterExponentiation(24637864786278436723,10,3)
#4 #puts remSqEuler(5,13)
#5 #puts squareRootFp(7,2)
#6 #puts primalityTest(10)
#1 puts random_gen_Zn(50,3)
#2 puts reciprocal_Phi_p(5,7)
#3 puts betterExponentiation(24637864786278436723,10,3)
#4 puts remSqEuler(5,13)
#5 puts squareRootFp(7,2)
#6 puts primalityTest(13)