欢迎来到天天文库
浏览记录
ID:58625452
大小:155.53 KB
页数:30页
时间:2020-10-17
《RSA加解密算法C语言的实现.pdf》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、;.#include#include#include#include#include#include#defineMAX100#defineLENsizeof(structslink)voidsub(inta[MAX],intb[MAX],intc[MAX]);structslink{intbignum[MAX];/*bignum[98]用来标记正负号,1正,0负bignum[99]来标记实际长度*/structslink*next;};/*/------
2、--------------------------------自己建立的大数运算库-------------------------------------*/voidprint(inta[MAX]){inti;for(i=0;il2)return1;if(l13、1);i>=0;i--){if(a1[i]>a2[i])return1;if(a1[i]4、elseif(a1[MAX-2]=='-')c[MAX-2]='-';elseif(a2[MAX-2]=='-')c[MAX-2]='-';for(i=0;i5、1,l2;intlen,temp[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){c[MAX-2]='-';}elseif(a1[MAX-2]=='-'){mov(a1,temp);temp[MAX-2]=0;sub(a2,temp,c);return;}elseif(a2[MAX-2]=='-'){mov(a2,temp);temp[98]=0;sub(a1,temp,c);return;}if(l16、;ilen){for(i=len;i7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei8、f(a1[
3、1);i>=0;i--){if(a1[i]>a2[i])return1;if(a1[i]4、elseif(a1[MAX-2]=='-')c[MAX-2]='-';elseif(a2[MAX-2]=='-')c[MAX-2]='-';for(i=0;i5、1,l2;intlen,temp[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){c[MAX-2]='-';}elseif(a1[MAX-2]=='-'){mov(a1,temp);temp[MAX-2]=0;sub(a2,temp,c);return;}elseif(a2[MAX-2]=='-'){mov(a2,temp);temp[98]=0;sub(a1,temp,c);return;}if(l16、;ilen){for(i=len;i7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei8、f(a1[
4、elseif(a1[MAX-2]=='-')c[MAX-2]='-';elseif(a2[MAX-2]=='-')c[MAX-2]='-';for(i=0;i5、1,l2;intlen,temp[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){c[MAX-2]='-';}elseif(a1[MAX-2]=='-'){mov(a1,temp);temp[MAX-2]=0;sub(a2,temp,c);return;}elseif(a2[MAX-2]=='-'){mov(a2,temp);temp[98]=0;sub(a1,temp,c);return;}if(l16、;ilen){for(i=len;i7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei8、f(a1[
5、1,l2;intlen,temp[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){c[MAX-2]='-';}elseif(a1[MAX-2]=='-'){mov(a1,temp);temp[MAX-2]=0;sub(a2,temp,c);return;}elseif(a2[MAX-2]=='-'){mov(a2,temp);temp[98]=0;sub(a1,temp,c);return;}if(l16、;ilen){for(i=len;i7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei8、f(a1[
6、;ilen){for(i=len;i7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei8、f(a1[
7、idsub(inta1[MAX],inta2[MAX],int*c){inti,l1,l2;intlen,t1[MAX],t2[MAX];intk=0;l1=a1[MAX-1];l2=a2[MAX-1];if((a1[MAX-2]=='-')&&(a2[MAX-2]=='-')){mov(a1,t1);mov(a2,t2);t1[MAX-2]=0;t2[MAX-2]=0;sub(t2,t1,c);return;};.';.elseif(a2[MAX-2]=='-'){mov(a2,t2);t2[MAX-2]=0;add(a1,t2,c);return;}elsei
8、f(a1[
此文档下载收益归作者所有