Merge branch 'master' of github.com:jedisct1/libsodium

* 'master' of github.com:jedisct1/libsodium:
  Do not clear the padding (for alignment) section of a blake2b state
This commit is contained in:
Frank Denis 2017-08-26 17:48:13 +02:00
commit 75cfcf208c

View File

@ -14,6 +14,7 @@
*/ */
#include <assert.h> #include <assert.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -160,11 +161,12 @@ static inline int
blake2b_init0(blake2b_state *S) blake2b_init0(blake2b_state *S)
{ {
int i; int i;
memset(S, 0, sizeof(blake2b_state));
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
S->h[i] = blake2b_IV[i]; S->h[i] = blake2b_IV[i];
} }
memset(S->t, 0, offsetof(blake2b_state, last_node) + sizeof(S->last_node)
- offsetof(blake2b_state, t));
return 0; return 0;
} }