Курсовая работа: Программирование алгоритма цифровой подписи ГОСТ Р 34.10-94
unsigned short s[S+1];
exp_mod(sign_a,sign_k,sign_p,res,w,S,S/2);
Div(res,sign_q,result,tmp,S,S/2);
mul(sign_x,tmp,res,S/2,S/2);
mul(sign_k,sign_m,result,S/2,S/2);
add(res,result,sum,S);
Div(sum,sign_q,s,tmp1,S,S/2);
for(int i=S/2-1, j=S-1; i>=0; i--, j--)
{sign[j]=tmp[i];
sign[j-16]=tmp1[i];}}
int verify(unsigned short p[],unsigned short a[],unsigned short q[],unsigned short y[], unsigned short m[],unsigned short sign[])
{unsigned short v[16];
unsigned short q_2[16];
unsigned short w[S];
unsigned short s[S/2];
unsigned short tmp[S];
unsigned short tmp_[S];
unsigned short tmp_1[S*2];
unsigned short tmp_2[S*2];
unsigned short tmp1[S/2];
unsigned short z1[S/2];
unsigned short z2[S/2];
unsigned short r_[S/2];
for(int i=S/2-1; i>=0; i--) q_2[i]=q[i];
q_2[0]=q_2[0]-0x0002;
exp_mod(m,q_2,q,v,w,S/2,S/2);
for(int b=S/2-1, j=S-1; b>=0; b--, j--)
{s[b]=sign[b];
r_[b]=sign[j];}