听闻论坛里有许多大神。小女子过来凑热闹啦。。。。
error C2665: 'PowerMod' : none of the 5 overloads can convert parameter 1 from type 'int'能帮我分析一下这个错误吗??
int bit=1024; unsigned char seeds[]="myseed"; char errbuf[256]; DSA *myDSA; //定义DSA结构体 myDSA = DSA_new(); myDSA = DSA_generate_parameters(bit, seeds, 6, NULL, NULL, NULL, NULL); //生成密钥参数 if (myDSA == NULL) { unsigned long errorcode = ERR_get_error(); ERR_error_string(errorcode, errbuf); printf("The error: %s", errbuf); return; } char *strp = BN_bn2dec(myDSA->p); //将16进制转化为10进制 char *strq = BN_bn2dec(myDSA->q); char *strg = BN_bn2dec(myDSA->g); ZZ m_q,m_g,m_p; m_p=to_ZZ(strp); m_q=to_ZZ(strq); m_g=to_ZZ(strg); cout<<endl;; cout<<"m_p="<<m_p<<"\n"<<endl; cout<<"m_q="<<m_q<<"\n"<<endl; cout<<"m_g="<<m_g<<"\n"<<endl; cout<<"按任意键继续\n"<<endl; getch(); //……………………密钥计算部分………………………… ZZ xa,xb,ya,yb; xa=RandomBnd(m_q-1)+1; //产生一个随机数,将其值赋给变量xa xb=RandomBnd(m_q-1)+1; ya=PowerMod(m_g,xa,m_p); //计算对应公钥 yb=PowerMod(m_g,xb,m_p); cout<<"Alice的私钥="<<xa<<endl; cout<<"按任意键计算Alice的公钥..."<<endl; getch(); cout<<"Alice的公钥="<<ya<<"\n"<<endl; cout<<"Bob的私钥="<<xb<<endl; cout<<"按任意键计算Bob的公钥..."<<endl; getch(); cout<<"Bob的公钥="<<yb<<"\n"<<endl; cout<<"…………密钥计算完毕…………\n"<<endl; getch();这个怎么样