亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ecdsa.cpp

?? 橢圓曲線簽名算法
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// ECDSA.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "ECDSA.h"

#include "MainFrm.h"
#include "ECDSADoc.h"
#include "ECDSAView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CECDSAApp

BEGIN_MESSAGE_MAP(CECDSAApp, CWinApp)
	//{{AFX_MSG_MAP(CECDSAApp)
	ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard file based document commands
	ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
	ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
	// Standard print setup command
	ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CECDSAApp construction

CECDSAApp::CECDSAApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CECDSAApp object

CECDSAApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CECDSAApp initialization

BOOL CECDSAApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	// Change the registry key under which our settings are stored.
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization.
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CECDSADoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CECDSAView));
	AddDocTemplate(pDocTemplate);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	// The one and only window has been initialized, so show and update it.
	m_pMainWnd->ShowWindow(SW_SHOW);
	m_pMainWnd->UpdateWindow();

	return TRUE;
}


/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About

class CAboutDlg : public CDialog
{
public:
	CAboutDlg();

// Dialog Data
	//{{AFX_DATA(CAboutDlg)
	enum { IDD = IDD_ABOUTBOX };
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CAboutDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	//{{AFX_MSG(CAboutDlg)
		// No message handlers
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
	//{{AFX_DATA_INIT(CAboutDlg)
	//}}AFX_DATA_INIT
}

void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAboutDlg)
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
	//{{AFX_MSG_MAP(CAboutDlg)
		// No message handlers
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

// App command to run the dialog
void CECDSAApp::OnAppAbout()
{
	CAboutDlg aboutDlg;
	aboutDlg.DoModal();
}

//BigInteger類的實現,自己定義的
#include "iostream.h"
#include "stdio.h"
#include "windows.h"
#include "string.h"
#include "stdlib.h"
#include "time.h"

static seed=0;

BigInteger::BigInteger()        //構造函數,將每個節點置空
{
	Head=End=TempNode=NULL;
}

BigInteger::BigInteger(char i)  //構造函數,只擁有一位的大整數
{
	Head=End=TempNode=NULL;
	TempNode=new Node;
	TempNode->Num=i;
	TempNode->Prev=NULL;
	Head=End=TempNode;
	TempNode->Next=NULL;	
}

BigInteger::BigInteger(const BigInteger &BigNum)     //拷貝構造
{
	Node *p;
	Head=End=TempNode=NULL;
	p=BigNum.Head;
	while(p)
	{
		AddEnd(p->Num);
		p=p->Next;
	}
}

BigInteger::~BigInteger()        //析構
{
	Node *NextNode;
	if(Head==NULL)
		return;
	TempNode=Head;
	while(TempNode)
	{
		NextNode=TempNode->Next;
		delete TempNode;
		TempNode=NextNode;
	}
	Head=NULL;
	End=NULL;
	TempNode=NULL;
}

void BigInteger::AddHead(char Num)        //在鏈表頭插入節點的操作
{
	TempNode=new Node;
	TempNode->Num=Num;
	TempNode->Prev=NULL;
	if(!Head)
	{
		Head=End=TempNode;
		TempNode->Next=NULL;
	}
	else
	{
		TempNode->Next=Head;
		Head->Prev=TempNode;
		Head=TempNode;
	}
}

void BigInteger::AddEnd(char Num)       //在鏈表尾插入節點的操作
{
	TempNode=new Node;
	TempNode->Num=Num;
	TempNode->Next=NULL;
	if(!Head)
	{
		Head=End=TempNode;
		TempNode->Prev=NULL;
	}
	else
	{
		TempNode->Prev=End;
		End->Next=TempNode;
		End=TempNode;
	}
}


//調整大整數,如果最前面是0的話則表明該數就是0
void AdjustBigNum(BigInteger &BigNum)
{
	Node *temp;
	temp=BigNum.Head;
	while (temp&&int(temp->Num)==0&&temp!=BigNum.End) 
	{
			BigNum.Head=temp->Next;
			delete temp;
			temp=BigNum.Head;
	}	
}
//將大整數轉化為二進制數,并不影響*this的值
void BigInteger::BigNumToIndex(int b[],int &count)
{
	BigInteger BigNum=*this,temp2(2),temp;
	count=0;
	while (int(BigNum.Head->Num))
	{
		temp=BigNum%temp2;
		b[count++]=int(temp.Head->Num);
		BigNum=BigNum/temp2;
	}
}
//正數
BigInteger BigInteger::operator ++()//重載++
{
	BigInteger temp(1);
	*this=*this+temp;
	AdjustBigNum(*this);
	return *this;
}
//正數
BigInteger BigInteger::operator --()//重載--
{
	int i=1;
	BigInteger temp;
	temp.AddHead(char(i));
	*this=*this-temp;
	AdjustBigNum(*this);
	return *this;
}

//大整數加運算,只能是兩正整數,需要處理負數時轉化為減法處理
BigInteger BigInteger::operator + (BigInteger BigNum2)//重載"+"
{ 
	BigInteger result;
	Node *temp1,*temp2;
	int TempNum,rest=0;
	temp1=this->End;//將臨時鏈表首地址放置到輸入鏈表的尾部
	temp2=BigNum2.End;
	while(temp1 && temp2)
	{
		TempNum=int(temp1->Num)+int(temp2->Num)+rest;//節點內元素相加并加上進位rest
		if(TempNum>9)//判斷相加結果是否會產生進位.
		{
			TempNum=TempNum-10;
			rest=1;
		}
		else
			rest=0;
		result.AddHead(char(TempNum));//將結果放置到最終結果鏈表里
		temp1=temp1->Prev;//將兩個相加的鏈表前移一位
		temp2=temp2->Prev;
	}
	if(temp2)
		temp1=temp2;//處理兩鏈表中剩下的部分
	while(temp1)
	{
		int(TempNum)=int(temp1->Num)+rest;//節點內元素加上進位rest
		if(TempNum>9)
		{
			TempNum=TempNum-10;
			rest=1;
		}
		else
			rest=0;
		result.AddHead(char(TempNum));//將結果放置到最終結果鏈表里
		temp1=temp1->Prev;
	}
	if(rest)
		result.AddHead(char(rest));//考慮最后的進位是否存在,如果存在則存入鏈表的首部.
	AdjustBigNum(result);
	return result;
}

//a-b,要求a>=b,小-大時調成大-小再加負號,a、b中有負的要轉為正的處理
BigInteger BigInteger::operator - (BigInteger BigNum2)//重載"-"
{
	BigInteger BigNum1=*this,temp,result;
	Node *temp1,*temp2;
	bool flag;
	int TempNum,rest=0;
	if (int(BigNum1.Head->Num)<0&&int(BigNum2.Head->Num)<0)
	{
		BigNum2.Head->Num=char(int(BigNum2.Head->Num)*(-1));//轉正
		BigNum1.Head->Num=char(int(BigNum1.Head->Num)*(-1));//轉正
		temp=BigNum1;
		BigNum1=BigNum2;
		BigNum2=temp;
	}
	if (int(BigNum1.Head->Num)<0&&int(BigNum2.Head->Num)>0) 
	{
		BigNum1.Head->Num=char(int(BigNum1.Head->Num)*(-1));//轉正
		result=BigNum2+BigNum1;
		result.Head->Num=char(int(result.Head->Num)*(-1));//變負
		return result;
	}
	if (int(BigNum1.Head->Num)>0&&int(BigNum2.Head->Num)<0) 
	{
		BigNum2.Head->Num=char(int(BigNum2.Head->Num)*(-1));//轉正
		result=BigNum2+BigNum1;
		return result;
	}
	
	if (Compare(BigNum1,BigNum2)==1) 
	{
		temp1=BigNum1.End;//將臨時鏈表首地址放置到輸入鏈表的尾部
		temp2=BigNum2.End;
		flag=true;
	}
	else
	{
		temp1=BigNum2.End;//將臨時鏈表首地址放置到輸入鏈表的尾部
		temp2=BigNum1.End;
		flag=false;
	}
	
	while(temp1 && temp2)
	{

		TempNum=int(temp1->Num)-int(temp2->Num)+rest;//節點內元素相加并加上借位rest
		if(TempNum<0)//判斷相加結果是否會產生借位.
		{
			TempNum=10+TempNum;
			rest=-1;
		}
		else
			rest=0;
		result.AddHead(char(TempNum));//將結果放置到最終結果鏈表里
		temp1=temp1->Prev;//將兩個相減的鏈表前移一位
		temp2=temp2->Prev;
	}
	//處理兩鏈表中剩下的部分	
	while(temp1)
	{
		int(TempNum)=int(temp1->Num)+rest;//節點內元素加上借位rest
		if(TempNum<0)
		{
			TempNum=10+TempNum;
			rest=-1;
		}
		else
			rest=0;
		result.AddHead(char(TempNum));//將結果放置到最終結果鏈表里
		temp1=temp1->Prev;
	}
	if(rest)
	{
		result.Head->Num-=10;
	}
	AdjustBigNum(result);
	if (!flag) 
	{
		result.Head->Num=char(int(result.Head->Num)*(-1));
	}
	return result;
}


BigInteger BigInteger::operator * (BigInteger BigNum2)//對*進行重載
{
	BigInteger BigNum1=*this,temp,result;
	Node *temp1,*temp2,*tempa,*tempb;
	bool flag=true;
	int TempNum,rest,i=0,rest2;
	int k;

	if (int(BigNum1.Head->Num)*int(BigNum2.Head->Num)<0) 
	{
		flag=false;
	}
	if (int(BigNum1.Head->Num)<0)
	{
		BigNum1.Head->Num=char(int(BigNum1.Head->Num)*(-1));
	}
	if (int(BigNum2.Head->Num)<0)
	{
		BigNum2.Head->Num=char(int(BigNum2.Head->Num)*(-1));
	}

	temp1=BigNum1.End;
	temp2=BigNum2.End;
	while(temp2)//由乘數的存在與否判斷是否去乘被乘數的每個位
	{
		rest=0;
		//對乘數中的每一位都逐一去乘被乘數
		while(temp1!=NULL)
		{
			TempNum=int(temp1->Num)*int(temp2->Num)+rest;
			if(TempNum>9)
			{ 
				rest=TempNum/10; //進位由相乘結果與10做商求得
				TempNum=TempNum%10; //由相乘結果與10求模取個位
			}
			else
				rest=0;
			temp.AddHead(char(TempNum));//存入臨時鏈表
			temp1=temp1->Prev;
		}
		if(rest!=0)
			temp.AddHead(char(rest));
		for(k=i;k>=1;k--)
			temp.AddEnd(char(0));//判斷應該在鏈表后面補幾個0
		i++; //每次乘完后計數,用來下一次的補0
		temp1=BigNum1.End;//把被乘數重新置到尾,用來讓乘數下一次去乘每個元素
		temp2=temp2->Prev;//將乘數取出鏈表的前驅
		tempa=result.End;//下面進行的是將每次乘數與被乘數的相乘結果累加放到最終鏈表里等待輸出
		if(result.Head!=NULL)//下面過程與"+"重載基本一樣,只是多了對臨時鏈表的置空.
		{
			result.End=temp.Head;
			result.Head=NULL;
		}
		tempb=temp.End;
		rest2=0;
		while(tempa!=NULL && tempb!=NULL)
		{
			TempNum=int(tempa->Num)+int(tempb->Num)+rest2;
			if(TempNum>9)
			{
				TempNum=TempNum-10;
				rest2=1;
			}
			else
				rest2=0;
			result.AddHead(char(TempNum));
			tempa=tempa->Prev;
			tempb=tempb->Prev;
		}
		if(tempb)
			tempa=tempb;
		while(tempa)
		{
			int(TempNum)=int(tempa->Num)+rest2;
			if(TempNum>9)
			{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区三区乱码| 欧美日韩高清一区二区| 欧美日韩久久一区二区| 国产欧美日韩在线| 亚洲一区二三区| 国产69精品一区二区亚洲孕妇| 欧美视频一二三区| 国产精品免费av| 九一九一国产精品| 欧美精品乱人伦久久久久久| 亚洲精选视频免费看| 国产精品91一区二区| 日韩视频一区二区在线观看| 亚洲黄色小说网站| 99久久婷婷国产| 国产天堂亚洲国产碰碰| 久久69国产一区二区蜜臀| 欧美日韩一本到| 亚洲美女电影在线| 91小视频在线| 亚洲视频在线观看三级| 不卡av在线网| 国产精品传媒视频| 岛国精品在线播放| 国产网红主播福利一区二区| 国产一区二区三区四| 91麻豆精品久久久久蜜臀| 成人精品鲁一区一区二区| 精品av综合导航| 激情偷乱视频一区二区三区| 欧美一级视频精品观看| 免费高清在线一区| 日韩欧美一卡二卡| 精品亚洲免费视频| 久久久精品国产99久久精品芒果 | 日韩精品亚洲一区二区三区免费| 国产精品一区二区久激情瑜伽| 精品三级av在线| 九一久久久久久| 久久你懂得1024| 国产成人午夜电影网| 久久婷婷色综合| 成人性视频免费网站| 中文字幕中文字幕中文字幕亚洲无线| 国产黄色精品视频| 亚洲丝袜制服诱惑| 欧美日韩国产综合视频在线观看 | 精品国产免费人成在线观看| 狠狠色丁香九九婷婷综合五月| 337p粉嫩大胆噜噜噜噜噜91av| 狠狠色2019综合网| 成人欧美一区二区三区小说| 91成人在线精品| 免费成人av在线播放| 26uuu国产电影一区二区| 成人自拍视频在线| 亚洲影视在线播放| 日韩免费高清av| 成人国产视频在线观看| 一区二区三区精品在线观看| 这里只有精品99re| 成人激情免费电影网址| 亚洲妇熟xx妇色黄| 国产亚洲精品aa午夜观看| 99免费精品在线| 三级影片在线观看欧美日韩一区二区| 日韩一级免费一区| 欧美日韩在线播放三区四区| 毛片一区二区三区| 国产精品不卡一区二区三区| 51精品久久久久久久蜜臀| 成人av动漫在线| 日韩**一区毛片| 中文字幕在线观看一区二区| 欧美人动与zoxxxx乱| 国产成人在线看| 亚洲成年人网站在线观看| 国产欧美日韩另类一区| 制服丝袜亚洲播放| 成人美女在线视频| 极品少妇xxxx精品少妇偷拍| 亚洲久本草在线中文字幕| 久久精品男人的天堂| 欧美日韩高清在线| 91浏览器打开| 国产精品88av| 精品一区二区三区蜜桃| 偷拍亚洲欧洲综合| 亚洲图片激情小说| 久久蜜桃av一区二区天堂 | 精品美女被调教视频大全网站| 91福利在线播放| 波多野结衣一区二区三区| 久久99精品久久久久婷婷| 午夜精品影院在线观看| 国产精品日韩精品欧美在线| 欧美videossexotv100| 欧美伦理视频网站| 色综合天天综合网国产成人综合天 | www.亚洲国产| 国产91精品免费| 国产电影一区二区三区| 美女mm1313爽爽久久久蜜臀| 日韩综合在线视频| 亚洲成人一区在线| 一区二区三区日韩欧美| 亚洲日韩欧美一区二区在线| 中文字幕不卡在线播放| 国产亚洲短视频| 亚洲国产岛国毛片在线| 国产天堂亚洲国产碰碰| 久久影院午夜片一区| 精品日韩在线一区| 亚洲精品一区二区三区影院| 日韩欧美一卡二卡| 欧美草草影院在线视频| 日韩欧美色综合| 精品国产百合女同互慰| 亚洲精品一区二区三区影院| 国产午夜精品一区二区| 中文乱码免费一区二区 | 欧美sm美女调教| 精品国产露脸精彩对白| 久久久精品2019中文字幕之3| 久久色在线观看| 自拍av一区二区三区| 一区二区理论电影在线观看| 亚洲国产综合91精品麻豆| 午夜久久久久久久久| 裸体歌舞表演一区二区| 国产不卡一区视频| 日韩一卡二卡三卡四卡| 精品成人在线观看| 亚洲国产精品成人久久综合一区| 中文字幕在线观看一区二区| 亚洲国产婷婷综合在线精品| 麻豆一区二区99久久久久| 国产不卡视频一区二区三区| av欧美精品.com| 欧美一区二区三区视频在线观看 | 久久99国产精品尤物| 国产高清久久久| 一本色道**综合亚洲精品蜜桃冫| 欧美亚洲综合色| 91精品国产福利在线观看| 久久婷婷久久一区二区三区| 综合网在线视频| 蜜臀久久99精品久久久画质超高清| 国产麻豆精品theporn| 99视频有精品| 欧美一区二区在线免费观看| 久久久电影一区二区三区| 亚洲精品免费一二三区| 另类小说欧美激情| 色就色 综合激情| 精品盗摄一区二区三区| 亚洲一区二区三区中文字幕在线| 精品一区二区在线看| 99re6这里只有精品视频在线观看| 91超碰这里只有精品国产| 国产精品美女久久久久av爽李琼 | 国产美女在线观看一区| 91麻豆国产福利精品| 日韩欧美一级二级| 亚洲久草在线视频| 国产精品996| 欧美一卡二卡在线观看| 亚洲免费伊人电影| 国产白丝精品91爽爽久久| 欧美精品v日韩精品v韩国精品v| 日本一区二区三区国色天香| 美女视频黄免费的久久| 色八戒一区二区三区| 国产精品麻豆视频| 激情深爱一区二区| 日韩三级在线免费观看| 亚洲一卡二卡三卡四卡 | 国产成人av电影在线| 91精品婷婷国产综合久久竹菊| 中文字幕在线一区二区三区| 精品无码三级在线观看视频| 欧美人妖巨大在线| 亚洲一区二区五区| 日本道在线观看一区二区| 亚洲视频在线一区观看| 99视频国产精品| 国产精品欧美精品| 国产成人精品www牛牛影视| 精品国产91久久久久久久妲己| 午夜精品久久一牛影视| 欧美视频三区在线播放| 亚洲精品国产精华液| 色菇凉天天综合网| 一卡二卡欧美日韩| 91九色02白丝porn| 亚洲综合色网站| 欧美在线三级电影| 亚洲第一久久影院| 欧美乱妇15p| 日本网站在线观看一区二区三区|