使用python的离散对数

时间:2018-07-24 04:56:45

标签: python logarithm

我有一组对数,分别是L1,L2和L3,这是我从论文《 2015年超安全路由器到路由器自发密钥交换系统》中检索到的:

enter image description here

enter image description here

enter image description here

enter image description here

这是方程式的结果:

enter image description here

给出alpha = 5,x = 15和p = 97的值。用Python实现后,我得到了错误的结果,该结果与表中的结果不同。

这是代码:

rmvirtualenv

这是我得到的结果:

a=5
x=15
p=97
i1=0.958478
i2=4.238835

L1=pow(a,x+i1)%p
L2=pow(a,x+i1+i2)%p
L3=pow(a,x+i2)%p

print ("L1",L1)
print ("L2",L2)
print ("L3",L3)

请帮助我确定代码中的错误。谢谢。

0 个答案:

没有答案
相关问题