X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost12sum.c;h=4936d7e4b27217edeafd4ac3e1f6cae20d86be83;hb=3786731e6b3f845ac4d63caf1089d28a37f1d0ae;hp=f59bc05e4c2f1e43f080e34f7f2b10f28a7662cb;hpb=871d031dfe7f3c411d8a9846edddf3f312eb01ac;p=openssl-gost%2Fengine.git diff --git a/gost12sum.c b/gost12sum.c index f59bc05..4936d7e 100644 --- a/gost12sum.c +++ b/gost12sum.c @@ -214,18 +214,18 @@ int hash_file(gost_hash_ctx * ctx, char *filename, char *sum, int mode) int hash_stream(gost_hash_ctx * ctx, int fd, char *sum) { unsigned char buffer[BUF_SIZE]; - unsigned char reverted_buffer[BUF_SIZE]; ssize_t bytes; + size_t i; start_hash12(ctx); while ((bytes = read(fd, buffer, BUF_SIZE)) > 0) { - hash12_block(ctx, reverted_buffer, bytes); + hash12_block(ctx, buffer, bytes); } if (bytes < 0) { return 0; } finish_hash12(ctx, buffer); - for (size_t i = 0; i < (hashsize / 8); i++) { + for (i = 0; i < (hashsize / 8); i++) { sprintf(sum + 2 * i, "%02x", buffer[i]); } return 1;