xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

資源簡介

ECC算法 C++實現 加解密 已經過測試

資源截圖

代碼片段和文件信息

#include?“iostream.h“
struct?pointer{
int?X;
int?Y;
}G;?

int?p;?//所選擇的質數
int?ab;
int?prikey;//私鑰
void?getparameter()???//輸入pab的函數
{
int?flag1=0;
while(!flag1)
{
cout<<“Please?input?a?prime?number:?“< ????cin>>p;
???? cout<<“Please?input?the?parameters(<“< ????cin>>a;
????cout<<“b:?“;
????cin>>b;
if((4*a*a*a+27*b*b)%p)?//4a^3+27b^2!=0?(mod?p)
flag1=1;
}
cout<<“now?we?have?the?ecc:?E“<}

void?getG()?//輸入基點G的函數
{
int?flag2=0;
int?flag3=0;
while(!flag2)
{
int?leftright;
while(!flag3)
{
cout<<“Please?input?the?G(0= cin>>G.X;
cout<<“Y=“;
cin>>G.Y;
if((G.X>p-1)||(G.Y>p-1))
cout<<“Invalid?number?input?again!“< else
flag3=1;
}

left=((G.Y)*(G.Y))%p;?//?y^2=x^3+ax+b??(mod?p)
right=((G.X)*(G.X)*(G.X)+a*(G.X)+b)%p;
if(left==right)???
flag2=1;
else?
{
cout<<“Not?a?pointer?on?the?curve!?Please?input?again!“< flag3=0;
}
}
}


int?getprikey()?//輸入私鑰函數
{
cout<<“Please?input?the?private?key:?“;
cin>>prikey;
cout< return?prikey;
}


struct?pointer?getpubkey(int?key?struct?pointer?P)//得到公鑰的函數,以基點,私鑰為參數返回公鑰
{

int?slope;/

評論

共有 條評論