Skip to content

Commit

Permalink
Fix msvc and clang warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Instand committed Oct 16, 2019
1 parent 29e1460 commit 6b5c15d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion sse/blake2bp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, u
P->fanout = PARALLELISM_DEGREE;
P->depth = 2;
P->leaf_length = 0;
P->node_offset = offset;
P->node_offset = (uint32_t)offset;
P->xof_length = 0;
P->node_depth = 0;
P->inner_length = BLAKE2B_OUTBYTES;
Expand Down
2 changes: 1 addition & 1 deletion sse/blake2sp.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, u
P->fanout = PARALLELISM_DEGREE;
P->depth = 2;
P->leaf_length = 0;
P->node_offset = offset;
P->node_offset = (uint32_t)offset;
P->xof_length = 0;
P->node_depth = 0;
P->inner_length = BLAKE2S_OUTBYTES;
Expand Down
8 changes: 4 additions & 4 deletions sse/blake2xb.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key,

/* Initialize parameter block */
S->P->digest_length = BLAKE2B_OUTBYTES;
S->P->key_length = keylen;
S->P->key_length = (uint8_t)keylen;
S->P->fanout = 1;
S->P->depth = 1;
store32( &S->P->leaf_length, 0 );
store32( &S->P->node_offset, 0 );
store32( &S->P->xof_length, outlen );
store32( &S->P->xof_length, (uint8_t)outlen );
S->P->node_depth = 0;
S->P->inner_length = 0;
memset( S->P->reserved, 0, sizeof( S->P->reserved ) );
Expand Down Expand Up @@ -115,8 +115,8 @@ int blake2xb_final( blake2xb_state *S, void *out, size_t outlen) {
for (i = 0; outlen > 0; ++i) {
const size_t block_size = (outlen < BLAKE2B_OUTBYTES) ? outlen : BLAKE2B_OUTBYTES;
/* Initialize state */
P->digest_length = block_size;
store32(&P->node_offset, i);
P->digest_length = (uint8_t)block_size;
store32(&P->node_offset, (uint8_t)i);
blake2b_init_param(C, P);
/* Process key if needed */
blake2b_update(C, root, BLAKE2B_OUTBYTES);
Expand Down
8 changes: 4 additions & 4 deletions sse/blake2xs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key,

/* Initialize parameter block */
S->P->digest_length = BLAKE2S_OUTBYTES;
S->P->key_length = keylen;
S->P->key_length = (uint8_t)keylen;
S->P->fanout = 1;
S->P->depth = 1;
store32( &S->P->leaf_length, 0 );
store32( &S->P->node_offset, 0 );
store16( &S->P->xof_length, outlen );
store16( &S->P->xof_length, (uint8_t)outlen );
S->P->node_depth = 0;
S->P->inner_length = 0;
memset( S->P->salt, 0, sizeof( S->P->salt ) );
Expand Down Expand Up @@ -114,8 +114,8 @@ int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) {
for (i = 0; outlen > 0; ++i) {
const size_t block_size = (outlen < BLAKE2S_OUTBYTES) ? outlen : BLAKE2S_OUTBYTES;
/* Initialize state */
P->digest_length = block_size;
store32(&P->node_offset, i);
P->digest_length = (uint8_t)block_size;
store32(&P->node_offset, (uint8_t)i);
blake2s_init_param(C, P);
/* Process key if needed */
blake2s_update(C, root, BLAKE2S_OUTBYTES);
Expand Down

0 comments on commit 6b5c15d

Please sign in to comment.