Skip to content

Commit

Permalink
fixed warnings on watchos
Browse files Browse the repository at this point in the history
  • Loading branch information
ypopovych committed May 8, 2021
1 parent e5b6e79 commit 3daac4b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Blake2.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Blake2'
s.version = '0.1.0'
s.version = '0.1.1'
s.summary = 'Swift wrapper for reference C implementation of Blake2 hashes.'

s.description = <<-DESC
Expand Down
8 changes: 4 additions & 4 deletions Sources/CBlake2/blake2bp-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static int blake2bp_init_leaf_param( blake2b_state *S, const blake2b_param *P )
return err;
}

static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, uint64_t offset )
static int blake2bp_init_leaf( blake2b_state *S, size_t outlen, size_t keylen, uint32_t offset )
{
blake2b_param P[1];
P->digest_length = (uint8_t)outlen;
Expand Down Expand Up @@ -92,7 +92,7 @@ int blake2bp_init( blake2bp_state *S, size_t outlen )
return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2bp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1;
if( blake2bp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;

S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
Expand All @@ -115,7 +115,7 @@ int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t
return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2bp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1;
if( blake2bp_init_leaf( S->S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;

S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
Expand Down Expand Up @@ -232,7 +232,7 @@ int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void
if( keylen > BLAKE2B_KEYBYTES ) return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2bp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1;
if( blake2bp_init_leaf( S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;

S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */

Expand Down
8 changes: 4 additions & 4 deletions Sources/CBlake2/blake2sp-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P )
return err;
}

static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint64_t offset )
static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint32_t offset )
{
blake2s_param P[1];
P->digest_length = (uint8_t)outlen;
Expand Down Expand Up @@ -89,7 +89,7 @@ int blake2sp_init( blake2sp_state *S, size_t outlen )
return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1;
if( blake2sp_init_leaf( S->S[i], outlen, 0, (uint32_t)i ) < 0 ) return -1;

S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
Expand All @@ -112,7 +112,7 @@ int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t
return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1;
if( blake2sp_init_leaf( S->S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;

S->R->last_node = 1;
S->S[PARALLELISM_DEGREE - 1]->last_node = 1;
Expand Down Expand Up @@ -230,7 +230,7 @@ int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void
if( keylen > BLAKE2S_KEYBYTES ) return -1;

for( i = 0; i < PARALLELISM_DEGREE; ++i )
if( blake2sp_init_leaf( S[i], outlen, keylen, i ) < 0 ) return -1;
if( blake2sp_init_leaf( S[i], outlen, keylen, (uint32_t)i ) < 0 ) return -1;

S[PARALLELISM_DEGREE - 1]->last_node = 1; /* mark last node */

Expand Down
4 changes: 2 additions & 2 deletions Sources/CBlake2/blake2xb-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key,
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, (uint32_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 @@ -79,7 +79,7 @@ int blake2xb_final( blake2xb_state *S, void *out, size_t outlen) {
blake2b_param P[1];
uint32_t xof_length = load32(&S->P->xof_length);
uint8_t root[BLAKE2B_BLOCKBYTES];
size_t i;
uint32_t i;

if (NULL == out) {
return -1;
Expand Down
2 changes: 1 addition & 1 deletion Sources/CBlake2/blake2xs-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int blake2xs_final(blake2xs_state *S, void *out, size_t outlen) {
blake2s_param P[1];
uint16_t xof_length = load16(&S->P->xof_length);
uint8_t root[BLAKE2S_BLOCKBYTES];
size_t i;
uint32_t i;

if (NULL == out) {
return -1;
Expand Down

0 comments on commit 3daac4b

Please sign in to comment.