byte buf[8];
int i;
memcpy(buf,w,8);
- memcpy(k,w+8,24);
+ memmove(k,w+8,24);
for(i=0;i<8;i++)
k[i+24]=buf[i]^k[i];
}
*/
static int hash_step(gost_ctx *c,byte *H,const byte *M)
{
- static byte U[32],W[32],V[32],S[32],Key[32];
+ byte U[32],W[32],V[32],S[32],Key[32];
int i;
/* Compute first key */
xor_blocks(W,H,M,32);
if (ctx->left)
{
/*There are some bytes from previous step*/
- int add_bytes = 32-ctx->left;
+ unsigned int add_bytes = 32-ctx->left;
if (add_bytes>length)
{
add_bytes = length;
byte buf[32];
byte H[32];
byte S[32];
- long long fin_len=ctx->len;
+ ghosthash_len fin_len=ctx->len;
byte *bptr;
memcpy(H,ctx->H,32);
memcpy(S,ctx->S,32);
fin_len<<=3; /* Hash length in BITS!!*/
while(fin_len>0)
{
- *(bptr++)=fin_len&0xFF;
+ *(bptr++)=(byte)(fin_len&0xFF);
fin_len>>=8;
};
hash_step(ctx->cipher_ctx,H,buf);
memcpy(hashval,H,32);
return 1;
}
-