資源簡介
利用GMP大數包和素性判定法,編程產生RSA加密算法中所用的大素數
代碼片段和文件信息
#include?
#include?
#include?
#include?“gmp.h“
#define?N?1500
void?GenerateBigPrime(mpz_t?pint?length?int?prob);
int?main()
{
int?length?prob;
length=1000;
prob=10;
mpz_t?p;
mpz_init(p);
srand(?(unsigned)time(?NULL?)?);
GenerateBigPrime(plength?prob);
gmp_printf(“p=%Zd\n“p);
return?0;
}
- 上一篇:B樣條曲線數據擬合代碼,c\\c++
- 下一篇:C++圖書管理系統課程設計報告
評論
共有 條評論