⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sm_rsa.cpp

📁 椭圆曲线密码C实现的
💻 CPP
字号:
// SM_RSA.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "rsa.h"
//#include "DBlock.h"
#include "conio.h"
int main(int argc, char* argv[])
{
	vlong out1,out2,out3,out4,out5,out6,out7;
	clock_t start,end;	
	int o,oo;
/*
	out1 = 12412349;
	out4 = out1;
	out5 = vlong(100000);
	start = clock();
	::modexp(out4,198001,100000,out3);
	o = out3;
	end = clock() - start; 	
	printf("end1: %d\n",end);

	start = clock();
	for(int i = 0;i<198000;i++)
	{
		out1 = out1*vlong(12412349);
		out1 = out1%out5;
//		if(out1>out5)
//			;
//		out1 = out5;
//		out1/out5;
//		vlong xx;
	}
	end = clock() - start;
	printf("end2: %d\n",end);
	oo = out1;
	getch();

	out4 = out1;
*/
//	cout << dump\n";


//	::findprime(out,60*8);
//	::randval(out,1000);
/*
	CDBlock theBlk(2539);
	unsigned  char str[] = "public key encryptions";
	theBlk.MToDigist(str,sizeof(str));
*/

	vlong	p,q,d,n,e;
	vlong	plain,cipher;
	private_key	thePrvtKey;
	thePrvtKey.create();

	plain = 'H';
	cipher = thePrvtKey.encrypt(plain);
	plain = thePrvtKey.decrypt(cipher);
	char  c = plain;
	
	printf("Hello World! %c\n",c);
	getch();
	return 0;
}

 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -