@@ -369,7 +369,7 @@ int keccak_done(hash_state *md, unsigned char *out)
369369#endif
370370
371371#ifdef LTC_SHA3
372- static LTC_INLINE int s_sha3_shake_concrete_done (struct sha3_state * sha3 , unsigned char * out , unsigned long outlen , process_fn proc_f )
372+ static LTC_INLINE int s_sha3_shake_concrete_done (struct sha3_state * sha3 , unsigned char * out , unsigned long outlen , unsigned char domain , process_fn proc_f )
373373{
374374 /* IMPORTANT NOTE: sha3_shake_done can be called many times */
375375 unsigned long idx ;
@@ -381,7 +381,7 @@ static LTC_INLINE int s_sha3_shake_concrete_done(struct sha3_state *sha3, unsign
381381
382382 if (!sha3 -> xof_flag ) {
383383 /* shake_xof operation must be done only once */
384- sha3 -> s [sha3 -> word_index ] ^= (sha3 -> saved ^ (CONST64 ( 0x1F ) << (sha3 -> byte_index * 8 )));
384+ sha3 -> s [sha3 -> word_index ] ^= (sha3 -> saved ^ ((( ulong64 )( domain ) ) << (sha3 -> byte_index * 8 )));
385385 sha3 -> s [SHA3_KECCAK_SPONGE_WORDS - sha3 -> capacity_words - 1 ] ^= CONST64 (0x8000000000000000 );
386386 proc_f (sha3 -> s );
387387 /* store sha3.s[] as little-endian bytes into sha3.sb */
@@ -408,7 +408,7 @@ static LTC_INLINE int s_sha3_shake_concrete_done(struct sha3_state *sha3, unsign
408408static LTC_INLINE int s_sha3_shake_done (hash_state * md , unsigned char * out , unsigned long outlen , process_fn proc_f )
409409{
410410 LTC_ARGCHK (md != NULL );
411- return s_sha3_shake_concrete_done (& md -> sha3 , out , outlen , proc_f );
411+ return s_sha3_shake_concrete_done (& md -> sha3 , out , outlen , 0x1f , proc_f );
412412}
413413
414414int sha3_shake_done (hash_state * md , unsigned char * out , unsigned long outlen )
@@ -419,7 +419,7 @@ int sha3_shake_done(hash_state *md, unsigned char *out, unsigned long outlen)
419419#if defined LTC_TURBO_SHAKE
420420static LTC_INLINE int s_turbo_shake_concrete_done (struct sha3_state * sha3 , unsigned char * out , unsigned long outlen )
421421{
422- return s_sha3_shake_concrete_done (sha3 , out , outlen , s_keccak_turbo_f );
422+ return s_sha3_shake_concrete_done (sha3 , out , outlen , 0x1f , s_keccak_turbo_f );
423423}
424424int turbo_shake_done (hash_state * md , unsigned char * out , unsigned long outlen )
425425{
0 commit comments