def _gen_param_e(self):
# use builtin RNG
rand = SystemRandom()
n_bits = self.n.bit_length()
phi = (self.p - 1) * (self.q - 1)
mx = min(phi - 1, n_bits // 80) # top limits are phi (exclusive) and N/80 (inclusive)
self.e = rand.randint(2, mx)
while gcd(self.e, phi) != 1:
self.e = rand.randint(2, mx)
cryptographically_secure_generators.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录