@@ -139,26 +139,26 @@ static const unsigned char blake2s_sigma[10][16] = {
139139 { 10 , 2 , 8 , 4 , 7 , 6 , 1 , 5 , 15 , 11 , 9 , 14 , 3 , 12 , 13 , 0 },
140140};
141141
142- static void blake2s_set_lastnode (hash_state * md ) { md -> blake2s .f [1 ] = 0xffffffffUL ; }
142+ static void s_blake2s_set_lastnode (hash_state * md ) { md -> blake2s .f [1 ] = 0xffffffffUL ; }
143143
144144/* Some helper functions, not necessarily useful */
145- static int blake2s_is_lastblock (const hash_state * md ) { return md -> blake2s .f [0 ] != 0 ; }
145+ static int s_blake2s_is_lastblock (const hash_state * md ) { return md -> blake2s .f [0 ] != 0 ; }
146146
147- static void blake2s_set_lastblock (hash_state * md )
147+ static void s_blake2s_set_lastblock (hash_state * md )
148148{
149149 if (md -> blake2s .last_node ) {
150- blake2s_set_lastnode (md );
150+ s_blake2s_set_lastnode (md );
151151 }
152152 md -> blake2s .f [0 ] = 0xffffffffUL ;
153153}
154154
155- static void blake2s_increment_counter (hash_state * md , const ulong32 inc )
155+ static void s_blake2s_increment_counter (hash_state * md , const ulong32 inc )
156156{
157157 md -> blake2s .t [0 ] += inc ;
158158 if (md -> blake2s .t [0 ] < inc ) md -> blake2s .t [1 ]++ ;
159159}
160160
161- static int blake2s_init0 (hash_state * md )
161+ static int s_blake2s_init0 (hash_state * md )
162162{
163163 int i ;
164164 XMEMSET (& md -> blake2s , 0 , sizeof (struct blake2s_state ));
@@ -171,11 +171,11 @@ static int blake2s_init0(hash_state *md)
171171}
172172
173173/* init2 xors IV with input parameter block */
174- static int blake2s_init_param (hash_state * md , const unsigned char * P )
174+ static int s_blake2s_init_param (hash_state * md , const unsigned char * P )
175175{
176176 unsigned long i ;
177177
178- blake2s_init0 (md );
178+ s_blake2s_init0 (md );
179179
180180 /* IV XOR ParamBlock */
181181 for (i = 0 ; i < 8 ; ++ i ) {
@@ -222,7 +222,7 @@ int blake2s_init(hash_state *md, unsigned long outlen, const unsigned char *key,
222222 P [O_FANOUT ] = 1 ;
223223 P [O_DEPTH ] = 1 ;
224224
225- err = blake2s_init_param (md , P );
225+ err = s_blake2s_init_param (md , P );
226226 if (err != CRYPT_OK ) return err ;
227227
228228 if (key ) {
@@ -291,9 +291,9 @@ int blake2s_256_init(hash_state *md) { return blake2s_init(md, 32, NULL, 0); }
291291 } while (0)
292292
293293#ifdef LTC_CLEAN_STACK
294- static int _blake2s_compress (hash_state * md , const unsigned char * buf )
294+ static int s__blake2s_compress (hash_state * md , const unsigned char * buf )
295295#else
296- static int blake2s_compress (hash_state * md , const unsigned char * buf )
296+ static int s_blake2s_compress (hash_state * md , const unsigned char * buf )
297297#endif
298298{
299299 unsigned long i ;
@@ -337,10 +337,10 @@ static int blake2s_compress(hash_state *md, const unsigned char *buf)
337337#undef ROUND
338338
339339#ifdef LTC_CLEAN_STACK
340- static int blake2s_compress (hash_state * md , const unsigned char * buf )
340+ static int s_blake2s_compress (hash_state * md , const unsigned char * buf )
341341{
342342 int err ;
343- err = _blake2s_compress (md , buf );
343+ err = s__blake2s_compress (md , buf );
344344 burn_stack (sizeof (ulong32 ) * (32 ) + sizeof (unsigned long ));
345345 return err ;
346346}
@@ -368,13 +368,13 @@ int blake2s_process(hash_state *md, const unsigned char *in, unsigned long inlen
368368 if (inlen > fill ) {
369369 md -> blake2s .curlen = 0 ;
370370 XMEMCPY (md -> blake2s .buf + (left % sizeof (md -> blake2s .buf )), in , fill ); /* Fill buffer */
371- blake2s_increment_counter (md , BLAKE2S_BLOCKBYTES );
372- blake2s_compress (md , md -> blake2s .buf ); /* Compress */
371+ s_blake2s_increment_counter (md , BLAKE2S_BLOCKBYTES );
372+ s_blake2s_compress (md , md -> blake2s .buf ); /* Compress */
373373 in += fill ;
374374 inlen -= fill ;
375375 while (inlen > BLAKE2S_BLOCKBYTES ) {
376- blake2s_increment_counter (md , BLAKE2S_BLOCKBYTES );
377- blake2s_compress (md , in );
376+ s_blake2s_increment_counter (md , BLAKE2S_BLOCKBYTES );
377+ s_blake2s_compress (md , in );
378378 in += BLAKE2S_BLOCKBYTES ;
379379 inlen -= BLAKE2S_BLOCKBYTES ;
380380 }
@@ -401,13 +401,13 @@ int blake2s_done(hash_state *md, unsigned char *out)
401401
402402 /* if(md->blake2s.outlen != outlen) return CRYPT_INVALID_ARG; */
403403
404- if (blake2s_is_lastblock (md )) {
404+ if (s_blake2s_is_lastblock (md )) {
405405 return CRYPT_ERROR ;
406406 }
407- blake2s_increment_counter (md , md -> blake2s .curlen );
408- blake2s_set_lastblock (md );
407+ s_blake2s_increment_counter (md , md -> blake2s .curlen );
408+ s_blake2s_set_lastblock (md );
409409 XMEMSET (md -> blake2s .buf + md -> blake2s .curlen , 0 , BLAKE2S_BLOCKBYTES - md -> blake2s .curlen ); /* Padding */
410- blake2s_compress (md , md -> blake2s .buf );
410+ s_blake2s_compress (md , md -> blake2s .buf );
411411
412412 for (i = 0 ; i < 8 ; ++ i ) { /* Output full hash to temp buffer */
413413 STORE32L (md -> blake2s .h [i ], buffer + i * 4 );
0 commit comments