def is_prime(n, t): for i in xrange(1, t): a = random.randint(2, n-1) #r = (a**n-1) % n r = p5_expm.expm(a, n-1, n) #print a , r if r != 1: return False return True
def is_prime(n, t): for i in xrange(1, t): a = random.randint(2, n - 1) #r = (a**n-1) % n r = p5_expm.expm(a, n - 1, n) #print a , r if r != 1: return False return True
def rsaDec(n,d,c): return p5_expm.expm(c, d, n)
def rsaEnc(n,e,m): return p5_expm.expm(m, e, n)