@@ -114,11 +114,13 @@ extern "C"{
114114
115115#include "hamsi_helper.c"
116116
117+ #ifdef USE_SPH_HAMSI224
117118static const sph_u32 IV224 [] = {
118119 SPH_C32 (0xc3967a67 ), SPH_C32 (0xc3bc6c20 ), SPH_C32 (0x4bc3bcc3 ),
119120 SPH_C32 (0xa7c3bc6b ), SPH_C32 (0x2c204b61 ), SPH_C32 (0x74686f6c ),
120121 SPH_C32 (0x69656b65 ), SPH_C32 (0x20556e69 )
121122};
123+ #endif
122124
123125/*
124126 * This version is the one used in the Hamsi submission package for
@@ -132,12 +134,15 @@ static const sph_u32 IV224[] = {
132134};
133135 */
134136
137+ #ifdef USE_SPH_HAMSI256
135138static const sph_u32 IV256 [] = {
136139 SPH_C32 (0x76657273 ), SPH_C32 (0x69746569 ), SPH_C32 (0x74204c65 ),
137140 SPH_C32 (0x7576656e ), SPH_C32 (0x2c204465 ), SPH_C32 (0x70617274 ),
138141 SPH_C32 (0x656d656e ), SPH_C32 (0x7420456c )
139142};
143+ #endif
140144
145+ #ifdef USE_SPH_HAMSI384
141146static const sph_u32 IV384 [] = {
142147 SPH_C32 (0x656b7472 ), SPH_C32 (0x6f746563 ), SPH_C32 (0x686e6965 ),
143148 SPH_C32 (0x6b2c2043 ), SPH_C32 (0x6f6d7075 ), SPH_C32 (0x74657220 ),
@@ -146,6 +151,7 @@ static const sph_u32 IV384[] = {
146151 SPH_C32 (0x43727970 ), SPH_C32 (0x746f6772 ), SPH_C32 (0x61706879 ),
147152 SPH_C32 (0x2c204b61 )
148153};
154+ #endif
149155
150156static const sph_u32 IV512 [] = {
151157 SPH_C32 (0x73746565 ), SPH_C32 (0x6c706172 ), SPH_C32 (0x6b204172 ),
@@ -316,6 +322,7 @@ static const sph_u32 alpha_f[] = {
316322 c0 = (sc->h[0] ^= s0); \
317323 } while (0)
318324
325+ #if defined(USE_SPH_HAMSI224 ) || defined(USE_SPH_HAMSI256 ) || defined(USE_SPH_HAMSI384 )
319326static void
320327hamsi_small (sph_hamsi_small_context * sc , const unsigned char * buf , size_t num )
321328{
@@ -424,6 +431,7 @@ hamsi_small_close(sph_hamsi_small_context *sc,
424431 for (u = 0 ; u < out_size_w32 ; u ++ )
425432 sph_enc32be (out + (u << 2 ), sc -> h [u ]);
426433}
434+ #endif
427435
428436#define DECL_STATE_BIG \
429437 sph_u32 c0, c1, c2, c3, c4, c5, c6, c7; \
@@ -742,6 +750,7 @@ hamsi_big_close(sph_hamsi_big_context *sc,
742750 }
743751}
744752
753+ #ifdef USE_SPH_HAMSI224
745754/* see sph_hamsi.h */
746755void
747756sph_hamsi224_init (void * cc )
@@ -771,7 +780,9 @@ sph_hamsi224_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
771780 hamsi_small_close (cc , ub , n , dst , 7 );
772781 hamsi_small_init (cc , IV224 );
773782}
783+ #endif
774784
785+ #ifdef USE_SPH_HAMSI256
775786/* see sph_hamsi.h */
776787void
777788sph_hamsi256_init (void * cc )
@@ -801,7 +812,9 @@ sph_hamsi256_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
801812 hamsi_small_close (cc , ub , n , dst , 8 );
802813 hamsi_small_init (cc , IV256 );
803814}
815+ #endif
804816
817+ #ifdef USE_SPH_HAMSI384
805818/* see sph_hamsi.h */
806819void
807820sph_hamsi384_init (void * cc )
@@ -831,6 +844,7 @@ sph_hamsi384_addbits_and_close(void *cc, unsigned ub, unsigned n, void *dst)
831844 hamsi_big_close (cc , ub , n , dst , 12 );
832845 hamsi_big_init (cc , IV384 );
833846}
847+ #endif
834848
835849/* see sph_hamsi.h */
836850void
0 commit comments