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
#Check if a prime number is a solinas prime | |
#ModPow and Miller Rabin test extracted from http://en.literateprograms.org/Miller-Rabin_primality_test_(Ruby) | |
MAX_EXPONENT = 160 | |
#Modular arithmetic power | |
def modPow(x, r, m) | |
y = r | |
z = x | |
v = 1 |