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

資源簡介

用c++實現的基于Diffie-Hellman協議的密鑰交換,包含求一個素數的本原根函數,但由于數據類型問題,不能求太大的素數的本原根。壓縮包中包含源代碼和可執行文件,代碼注釋清晰。

資源截圖

代碼片段和文件信息

#include?
using?namespace?std;
#include?
#include?

//獲取素數P的本原根,返回2->p-1中最小的那個本原根?
//迫于數據大小的壓力(求指數總是溢出),素數37以上的素數無法精確計算出其本原根?
int?getGeneatorOfPrim(int?p){
int?g_array[p-1]?=?{0};
int?mod?=?0;
for(int?i=2;?i<=p-1;?i++){ //此次循環測試2?--?p-1中哪個數是本原根?
int?geneator?=?i;
unsigned?long?int?a?=?(unsigned?long?int)i;
mod?=?(int)(a?%?p);

for(int?j=0;?j g_array[j]?=?mod;
//cout?< a?=?a*i;
mod?=?(int)(a?%?p);?
}
//cout<<“****************************“<
int?g_repeat[p-1]?=?{0};//用于判斷g_array中是否有重復元素?
bool?repeat?=?false; //沒有使用雙重循環,減少時間復雜度?
for(int?k=0;?k if(g_repeat[g_array[k]-1]?==?1){
repeat?=?true;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-05-10?13:29??Diffie-Hellmam\
?????文件????????2720??2019-05-10?12:46??Diffie-Hellmam\Diff.cpp
?????文件?????1923837??2019-05-10?12:47??Diffie-Hellmam\Diff.exe

評論

共有 條評論

相關資源