diff options
Diffstat (limited to 'src/hash/blake2.c')
| -rw-r--r-- | src/hash/blake2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/hash/blake2.c b/src/hash/blake2.c index 61c79ca..9507c96 100644 --- a/src/hash/blake2.c +++ b/src/hash/blake2.c @@ -231,7 +231,7 @@ void blake2b_final(struct blake2b_hash* hash, char* out_stream){ blake2b_round(hash, 1);
- for(int i = 0; i != hash->digest_len; i++)sprintf(out_stream, "%s%02x", out_stream, (((uint8_t*)hash->hash)[i]));
+ for(int i = 0; i != hash->digest_len; i++)sprintf(out_stream + i * 2, "%02x", (((uint8_t*)hash->hash)[i]));
memcpy(hash, &old_hash, sizeof * hash);
memcpy(hash->buffer, old, bs_2);
@@ -363,7 +363,7 @@ void blake2s_final(struct blake2s_hash* hash, char* out_stream){ blake2s_round(hash, 1);
- for(int i = 0; i != hash->digest_len; i++)sprintf(out_stream, "%s%02x", out_stream, (((uint8_t*)hash->hash)[i]));
+ for(int i = 0; i != hash->digest_len; i++)sprintf(out_stream + i * 2, "%02x", (((uint8_t*)hash->hash)[i]));
memcpy(hash, &old_hash, sizeof * hash);
memcpy(hash->buffer, old, bs);
|
