我需要迭代生成数字x,这遵循这些条件
我需要它,因为我在RSA上实施定时攻击,并且需要生成这样的数字来测量时间而不模块化减少
感谢。
答案 0 :(得分:0)
如果事先不知道z值列表,你可以试试coroutine:
def compute_current(x, n, z):
# some computation here
def crunch(x, n):
current = x
z = yield current
while True:
current = compute_current(current, n, z)
z = yield current
c = crunch(x=10)
next(c)
new_x = crunch.send(some_z)
newer_x = crunch.send(some_other_z)
...