diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2014-04-08 20:15:18 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2014-04-08 20:15:18 +0000 |
commit | 06369e3974fbc83d3778807c090fbe69f20a27d4 (patch) | |
tree | 287eb1e7dc05df721bd9cce14889bd9c693295e3 /engines | |
parent | 2dc7f78169ea4545102b8d9b0604f785cdc798f5 (diff) | |
download | src-06369e3974fbc83d3778807c090fbe69f20a27d4.tar.gz src-06369e3974fbc83d3778807c090fbe69f20a27d4.zip |
Import OpenSSL 1.0.1g.vendor/openssl/1.0.1g
Approved by: benl (maintainer)
Notes
Notes:
svn path=/vendor-crypto/openssl/dist/; revision=264271
svn path=/vendor-crypto/openssl/1.0.1g/; revision=264272; tag=vendor/openssl/1.0.1g
Diffstat (limited to 'engines')
-rw-r--r-- | engines/ccgost/gosthash.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/ccgost/gosthash.c b/engines/ccgost/gosthash.c index 8c278aa6452e..91b2ce8829d8 100644 --- a/engines/ccgost/gosthash.c +++ b/engines/ccgost/gosthash.c @@ -180,8 +180,6 @@ int start_hash(gost_hash_ctx *ctx) */ int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length) { - const byte *curptr=block; - const byte *barrier=block+(length-32);/* Last byte we can safely hash*/ if (ctx->left) { /*There are some bytes from previous step*/ @@ -196,24 +194,25 @@ int hash_block(gost_hash_ctx *ctx,const byte *block, size_t length) { return 1; } - curptr=block+add_bytes; + block+=add_bytes; + length-=add_bytes; hash_step(ctx->cipher_ctx,ctx->H,ctx->remainder); add_blocks(32,ctx->S,ctx->remainder); ctx->len+=32; ctx->left=0; } - while (curptr<=barrier) + while (length>=32) { - hash_step(ctx->cipher_ctx,ctx->H,curptr); + hash_step(ctx->cipher_ctx,ctx->H,block); - add_blocks(32,ctx->S,curptr); + add_blocks(32,ctx->S,block); ctx->len+=32; - curptr+=32; + block+=32; + length-=32; } - if (curptr!=block+length) + if (length) { - ctx->left=block+length-curptr; - memcpy(ctx->remainder,curptr,ctx->left); + memcpy(ctx->remainder,block,ctx->left=length); } return 1; } |