mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-20 10:37:24 -07:00
crypto_hash_sha256_update() cannot fail
This commit is contained in:
parent
613ab79a27
commit
06e70b085b
@ -286,10 +286,7 @@ crypto_hash(unsigned char *out, const unsigned char *in,
|
|||||||
crypto_hash_sha256_state state;
|
crypto_hash_sha256_state state;
|
||||||
|
|
||||||
crypto_hash_sha256_init(&state);
|
crypto_hash_sha256_init(&state);
|
||||||
if (crypto_hash_sha256_update(&state, in, inlen) != 0) {
|
crypto_hash_sha256_update(&state, in, inlen);
|
||||||
sodium_memzero(out, crypto_hash_BYTES);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
crypto_hash_sha256_final(&state, out);
|
crypto_hash_sha256_final(&state, out);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user