summaryrefslogtreecommitdiffstats
path: root/Modules/_blake2/impl/blake2s-ref.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2016-09-06 21:18:03 (GMT)
committerChristian Heimes <christian@python.org>2016-09-06 21:18:03 (GMT)
commit87bf0febcb59a389eb62bcb467b7ec9c4974be49 (patch)
tree2dba478dc8c94bf595fd8e491f2fd32df18a11f4 /Modules/_blake2/impl/blake2s-ref.c
parent90493ab30cd746d9063ec4cb76ad24e77da34702 (diff)
downloadcpython-87bf0febcb59a389eb62bcb467b7ec9c4974be49.zip
cpython-87bf0febcb59a389eb62bcb467b7ec9c4974be49.tar.gz
cpython-87bf0febcb59a389eb62bcb467b7ec9c4974be49.tar.bz2
Issue #26798: for loop initial declarations are only allowed in C99 or C11 mode
Diffstat (limited to 'Modules/_blake2/impl/blake2s-ref.c')
-rw-r--r--Modules/_blake2/impl/blake2s-ref.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_blake2/impl/blake2s-ref.c b/Modules/_blake2/impl/blake2s-ref.c
index 0e246c3..0cf4707 100644
--- a/Modules/_blake2/impl/blake2s-ref.c
+++ b/Modules/_blake2/impl/blake2s-ref.c
@@ -138,9 +138,10 @@ BLAKE2_LOCAL_INLINE(int) blake2s_param_set_personal( blake2s_param *P, const uin
BLAKE2_LOCAL_INLINE(int) blake2s_init0( blake2s_state *S )
{
+ int i;
memset( S, 0, sizeof( blake2s_state ) );
- for( int i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
+ for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i];
return 0;
}
@@ -308,6 +309,7 @@ int blake2s_update( blake2s_state *S, const uint8_t *in, uint64_t inlen )
int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen )
{
uint8_t buffer[BLAKE2S_OUTBYTES] = {0};
+ int i;
if( out == NULL || outlen == 0 || outlen > BLAKE2S_OUTBYTES )
return -1;
@@ -329,7 +331,7 @@ int blake2s_final( blake2s_state *S, uint8_t *out, uint8_t outlen )
memset( S->buf + S->buflen, 0, 2 * BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */
blake2s_compress( S, S->buf );
- for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
+ for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );
memcpy( out, buffer, outlen );