密码学学习
文章平均质量分 79
bluestar628
在校大学生
展开
-
模p平方根算法实现
#include #include #include using namespace std;int power(int x,int y,int m)//cal x^y%m{ if(y==0)return 1%m; int ret=x%m; for(int i=0;i<y-1;i++) ret=(ret*x)%m; return ret;}int normal_pow原创 2017-06-09 21:22:05 · 5201 阅读 · 0 评论 -
ss素性检验实现与雅克比符号计算
最近在做ss素性检验,记录一下算法的实现过程。关键是雅克比符号的计算,之前一直很糊涂。也记录一下#include #include #include using namespace std;long long power(int x,int y,int m)//cal x^y%m{ if(y==0)return 1%m; long long ret=x%m; for(i原创 2017-06-09 21:11:47 · 903 阅读 · 0 评论