Курсовая работа: Программирование алгоритма цифровой подписи ГОСТ Р 34.10-94
add_c[i]=LOWORD(T);
d=HIWORD(T);}
add_c[add_l_a_b]=d;}
void sub(unsigned short sub_a[], unsigned short sub_b[],unsigned short sub_c[], int sub_l_a_b)
{unsigned long T;
unsigned short d;
d=0;
for(int i=0; i<=(sub_l_a_b-1); i++)
{T=(unsigned long)sub_a[i]-(unsigned long)sub_b[i]-d;
sub_c[i]=LOWORD(T);
if(HIWORD(T)==0) d=0;
else d=1;}
sub_c[sub_l_a_b]=d;}
/*multiplication c=a*b*/
void mul(unsigned short mul_a[], unsigned short mul_b[],unsigned short mul_c[],int mul_l_a, int mul_l_b)
{unsigned long T;
unsigned short d;
for(int z=0; z<=(mul_l_a-1); z++)
{mul_c[z]=0;}
for(int i=0; i<=(mul_l_a-1); i++)
{d=0;
for(int j=0; j<=(mul_l_b-1); j++)
{T=(unsigned long) mul_c[i+j]+(unsigned long) mul_a[i]*(unsigned long) mul_b[j]+d;
mul_c[i+j]=LOWORD(T);
d=HIWORD(T);}
mul_c[i+mul_l_b]=d;}}
/*c=(a*b) mod m*/
void mul_mod(unsigned short mm_a[], unsigned short mm_b[], unsigned short mm_n[], unsigned short mm_ost[], unsigned short w1[], int mm_l_a_b_n, int t)
{unsigned short *mm_d;