#coding:utf=8
from libnum import *
from random import *
def Miller_Rabin(n):
if n == 2 or n == 3:
return True
if n & 1 == 0:
return False
s , d = 0 , n-1
while d % 2 == 0:
s += 1
d //= 2
for i in xrange(80):#进行80轮检验
a = randrange(2,n-1)#按递增的方式产生随机数
k = pow(a,d,n)
密码学课程设计之RSA
最新推荐文章于 2021-12-18 15:37:58 发布