diff --git a/Blake2.podspec b/Blake2.podspec index 01b2add..0e409f5 100644 --- a/Blake2.podspec +++ b/Blake2.podspec @@ -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 diff --git a/Sources/CBlake2/blake2bp-ref.c b/Sources/CBlake2/blake2bp-ref.c index d58a152..720df89 100644 --- a/Sources/CBlake2/blake2bp-ref.c +++ b/Sources/CBlake2/blake2bp-ref.c @@ -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; @@ -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; @@ -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; @@ -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 */ diff --git a/Sources/CBlake2/blake2sp-ref.c b/Sources/CBlake2/blake2sp-ref.c index b0e9bae..ebfe2e2 100644 --- a/Sources/CBlake2/blake2sp-ref.c +++ b/Sources/CBlake2/blake2sp-ref.c @@ -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; @@ -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; @@ -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; @@ -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 */ diff --git a/Sources/CBlake2/blake2xb-ref.c b/Sources/CBlake2/blake2xb-ref.c index b369ee7..2d15f5d 100644 --- a/Sources/CBlake2/blake2xb-ref.c +++ b/Sources/CBlake2/blake2xb-ref.c @@ -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 ) ); @@ -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; diff --git a/Sources/CBlake2/blake2xs-ref.c b/Sources/CBlake2/blake2xs-ref.c index e7a89f8..e0441f8 100644 --- a/Sources/CBlake2/blake2xs-ref.c +++ b/Sources/CBlake2/blake2xs-ref.c @@ -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;