~ubuntu-branches/debian/sid/samhain/sid

« back to all changes in this revision

Viewing changes to src/sh_tiger1_64.c

  • Committer: Bazaar Package Importer
  • Author(s): Javier Fernandez-Sanguino Pen~a
  • Date: 2006-08-19 10:38:36 UTC
  • mfrom: (1.2.1 upstream) (3.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20060819103836-3mhhosrrqe1h33zv
Tags: 2.2.3-2
Disable GCC_STACK_PROTECT from the autoconf definition as this
introduces a FTBFS currently. Should be reenabled once this
issue is fixed (Closes: #382617)

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
#include "config_xor.h"
6
6
 
7
 
#ifdef HAVE_LONG_LONG
8
 
/*@-incondefs -macroparens -macroassign -macroparams -macrostmt @*/
9
 
/*@-fixedformalarray +charindex -type -paramuse -predboolint -exportlocal@*/
 
7
#if defined(TIGER_64_BIT)
 
8
 
 
9
/* #if defined(HAVE_LONG_64) || defined(HAVE_LONG_LONG_64) */
 
10
 
 
11
#undef USE_MEMSET
 
12
 
10
13
/* Big endian:                                         */
11
14
#ifdef WORDS_BIGENDIAN
12
15
#define BIG_ENDIAN
13
16
#endif
14
17
 
15
 
 
16
18
/* Tiger: A Fast New Hash Function
17
19
 *
18
20
 * Ross Anderson and Eli Biham
34
36
 * and rja14@cl.cam.ac.uk.
35
37
 */ 
36
38
 
37
 
 
 
39
#if defined(HAVE_LONG_64)
 
40
typedef unsigned long int word64;
 
41
#elif defined(HAVE_LONG_LONG_64)
38
42
typedef unsigned long long int word64;
 
43
#else
 
44
#error No 64 bit type found !
 
45
#endif
39
46
 
40
47
#if defined(HAVE_INT_32)
41
48
typedef unsigned int sh_word32;
44
51
#elif defined(HAVE_SHORT_32)
45
52
typedef unsigned short sh_word32;
46
53
#else
47
 
#error No 32 byte type found !
 
54
#error No 32 bit type found !
48
55
#endif
49
56
 
50
57
typedef unsigned char sh_byte;
51
58
 
52
 
/* Big endian:                                         
53
 
   #if !(defined(__alpha)||defined(__i386__)||defined(__vax__))
54
 
   #define BIG_ENDIAN
55
 
   #endif
56
 
*/
57
 
 
58
 
/* The following macro denotes that an optimization    */
59
 
/* for Alpha is required. It is used only for          */
60
 
/* optimization of time. Otherwise it does nothing.    */
61
 
#ifdef __alpha
62
 
#define OPTIMIZE_FOR_ALPHA
 
59
#if defined(TIGER_OPT_ASM)
 
60
#define TIGER_ASM64_2 1
 
61
#else
 
62
#define TIGER_C 1
63
63
#endif
64
64
 
65
 
/* NOTE that this code is NOT FULLY OPTIMIZED for any  */
66
 
/* machine. Assembly code might be much faster on some */
67
 
/* machines, especially if the code is compiled with   */
68
 
/* gcc.                                                */
69
 
 
70
 
/* The number of passes of the hash function.          */
71
 
/* Three passes are recommended.                       */
72
 
/* Use four passes when you need extra security.       */
73
 
/* Must be at least three.                             */
 
65
/* The number of passes of the hash function.              */
 
66
/* Three passes are recommended.                           */
 
67
/* Use four passes when you need extra security.           */
 
68
/* Must be at least three.                                 */
74
69
#define PASSES 3
75
70
 
76
71
extern word64 tiger_table[4*256];
77
72
 
 
73
/* Volatile can help if compiler is smart enough to use memory operand */
 
74
static /*volatile*/ const word64 XOR_CONST1=0xA5A5A5A5A5A5A5A5LL;
 
75
static /*volatile*/ const word64 XOR_CONST2=0x0123456789ABCDEFLL;
 
76
 
78
77
#define t1 (tiger_table)
79
78
#define t2 (tiger_table+256)
80
79
#define t3 (tiger_table+256*2)
81
80
#define t4 (tiger_table+256*3)
82
81
 
 
82
#define pass_start
 
83
#define pass_end
 
84
 
 
85
 
 
86
 
83
87
#define save_abc \
84
 
      aa = a; \
85
 
      bb = b; \
86
 
      cc = c;
87
 
 
88
 
#ifdef OPTIMIZE_FOR_ALPHA
89
 
/* This is the official definition of round */
90
 
#define round(a,b,c,x,mul) \
91
 
      c ^= x; \
92
 
      a -= t1[((c)>>(0*8))&0xFF] ^ t2[((c)>>(2*8))&0xFF] ^ \
93
 
           t3[((c)>>(4*8))&0xFF] ^ t4[((c)>>(6*8))&0xFF] ; \
94
 
      b += t4[((c)>>(1*8))&0xFF] ^ t3[((c)>>(3*8))&0xFF] ^ \
95
 
           t2[((c)>>(5*8))&0xFF] ^ t1[((c)>>(7*8))&0xFF] ; \
96
 
      b *= mul;
97
 
#else
98
 
/* This code works faster when compiled on 32-bit machines */
99
 
/* (but works slower on Alpha) */
100
 
#define round(a,b,c,x,mul) \
101
 
      c ^= x; \
102
 
      a -= t1[(sh_byte)(c)] ^ \
103
 
           t2[(sh_byte)(((sh_word32)(c))>>(2*8))] ^ \
104
 
           t3[(sh_byte)((c)>>(4*8))] ^ \
105
 
           t4[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(2*8))] ; \
106
 
      b += t4[(sh_byte)(((sh_word32)(c))>>(1*8))] ^ \
107
 
           t3[(sh_byte)(((sh_word32)(c))>>(3*8))] ^ \
108
 
           t2[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(1*8))] ^ \
109
 
           t1[(sh_byte)(((sh_word32)((c)>>(4*8)))>>(3*8))]; \
110
 
      b *= mul;
111
 
#endif
112
 
 
113
 
#define pass(a,b,c,mul) \
114
 
      round(a,b,c,x0,mul) \
115
 
      round(b,c,a,x1,mul) \
116
 
      round(c,a,b,x2,mul) \
117
 
      round(a,b,c,x3,mul) \
118
 
      round(b,c,a,x4,mul) \
119
 
      round(c,a,b,x5,mul) \
120
 
      round(a,b,c,x6,mul) \
121
 
      round(b,c,a,x7,mul)
 
88
          aa = a; \
 
89
          bb = b; \
 
90
          cc = c;
 
91
 
 
92
#ifdef TIGER_C
 
93
 
 
94
#define BN(x,n) (((x)>>((n)*8))&0xFF)
 
95
 
 
96
 
 
97
/* Depending on outer code one of these two can be better*/
 
98
#define roundX(a,b,c,x) \
 
99
        c ^= x; \
 
100
        a -= t1[BN(c,0)] ^ t2[BN(c,2)] ^ \
 
101
             t3[BN(c,4)] ^ t4[BN(c,6)] ; \
 
102
        b += t4[BN(c,1)] ^ t3[BN(c,3)] ^ \
 
103
             t2[BN(c,5)] ^ t1[BN(c,7)] ;
 
104
 
 
105
#define round5(a,b,c,x) roundX(a,b,c,x) b = b+b*4;
 
106
#define round7(a,b,c,x) roundX(a,b,c,x) b = b*8-b;
 
107
#define round9(a,b,c,x) roundX(a,b,c,x) b = b+b*8;
 
108
 
 
109
#endif
 
110
 
 
111
 
 
112
#ifdef TIGER_OPT_ASM
 
113
 
 
114
#define MASK0           0xFFL
 
115
#define MASK8           0xFF00L
 
116
#define MASK16          0xFF0000L
 
117
#define MASK32          0xFF00000000LL
 
118
#define MASK40          0xFF0000000000LL
 
119
#define MASK48          0xFF000000000000LL
 
120
 
 
121
#define roundstart      __asm__ (
 
122
 
 
123
/* a will be moved into different reg each round
 
124
 * using register substitution feature of  GCC asm
 
125
 * b will be moved in 2-nd pass rounds only
 
126
 */
 
127
 
 
128
 
 
129
#define roundend(a,b,c,x) \
 
130
 : "+r" (a), "+r" (b), "+r" (c) \
 
131
 : "r" (a), "r" (b), "r" (c), "m" (x), "r" (&tiger_table),\
 
132
  "i" (MASK0), "i" (MASK8), "i" (MASK16), "r" (MASK32), "r" (MASK40), "r" (MASK48) \
 
133
 : "3", "%rax","%rbx","%rcx","%rdx","%rsi", "%edi", "%r8"  );
 
134
 
 
135
 
 
136
/*      c ^= x; 
 
137
        a -= t1[BN(c,0)] ^ t2[BN(c,2)] ^ 
 
138
        t3[BN(c,4)] ^ t4[BN(c,6)] ; 
 
139
        b += t4[BN(c,1)] ^ t3[BN(c,3)] ^ 
 
140
        t2[BN(c,5)] ^ t1[BN(c,7)] ;     */
 
141
 
 
142
#define roundX(a,b,c,x)   \
 
143
"       movl    %10, %%ebx      \n"\
 
144
"       movq    %11, %%rcx      \n"\
 
145
"       movq    %13, %%rdx      \n"\
 
146
"       movq    %6, %%r8  \n"\
 
147
"       xorq    %%r8, %2                 \n" \
 
148
"       andq    %2, %%rbx  \n"\
 
149
"       andq    %2, %%rcx  \n"\
 
150
"       andq    %2, %%rdx  \n"\
 
151
"       shrl    $(16-3), %%ebx  \n"\
 
152
"       shrq    $(32-3), %%rcx  \n"\
 
153
"       shrq    $(48-3), %%rdx  \n"\
 
154
"       movzbl  %2b, %%eax      \n"\
 
155
"       movzwl  %2w, %%edi      \n"\
 
156
"       movq    (%7,%%rax,8), %%rsi  \n"\
 
157
"       shrl    $(8), %%edi  \n" \
 
158
"       movq    %2, %%rax  \n" \
 
159
"       xorq    (2048*1)(%7,%%rbx), %%rsi  \n"\
 
160
"       movq    %2, %%rbx  \n"\
 
161
"       shrl    $24, %%eax \n"\
 
162
"       andq    %12, %%rbx      \n"\
 
163
"       xorq    (2048*2)(%7,%%rcx), %%rsi  \n"\
 
164
"       shrq    $(40-3), %%rbx \n"\
 
165
"       movq    %2, %%rcx  \n"\
 
166
"       xorq    (2048*3)(%7,%%rdx), %%rsi  \n"\
 
167
"       movq    (2048*3)(%7,%%rdi,8), %%rdx  \n"\
 
168
"       shrq    $56, %%rcx \n"\
 
169
"       xorq    (2048*2)(%7,%%rax,8), %%rdx  \n"\
 
170
"       xorq    (2048*1)(%7,%%rbx), %%rdx  \n" \
 
171
"       subq     %%rsi, %0 \n"\
 
172
"       xorq    (%7,%%rcx,8), %%rdx  \n"\
 
173
"       addq     %%rdx, %1 \n"
 
174
 
 
175
#define round5(a,b,c,x) \
 
176
        roundstart \
 
177
        roundX(a,b,c,x) \
 
178
        /* b*=5; */ \
 
179
        "leaq   (%1,%1,4), %1\n" \
 
180
        roundend(a,b,c,x)
 
181
 
 
182
 
 
183
#define round7(a,b,c,x) \
 
184
        roundstart \
 
185
        roundX(a,b,c,x) \
 
186
        roundend(a,b,c,x) \
 
187
        /* b*=7; */ \
 
188
        __asm__ ( \
 
189
        "leaq   (%1,%1,8), %0\n" \
 
190
        "addq  %1, %1 \n" \
 
191
        "subq  %1, %0 " \
 
192
        :"=&r" (b): "r"(b): "1" );
 
193
 
 
194
#define round9(a,b,c,x) \
 
195
        roundstart \
 
196
        roundX(a,b,c,x) \
 
197
        "leaq   (%1,%1,8), %1\n" \
 
198
        roundend(a,b,c,x)
 
199
 
 
200
#endif
 
201
 
 
202
 
 
203
 
 
204
 
 
205
/* ============== Common macros ================== */
122
206
 
123
207
#define key_schedule \
124
 
      x0 -= x7 ^ 0xA5A5A5A5A5A5A5A5LL; \
125
 
      x1 ^= x0; \
126
 
      x2 += x1; \
127
 
      x3 -= x2 ^ ((~x1)<<19); \
128
 
      x4 ^= x3; \
129
 
      x5 += x4; \
130
 
      x6 -= x5 ^ ((~x4)>>23); \
131
 
      x7 ^= x6; \
132
 
      x0 += x7; \
133
 
      x1 -= x0 ^ ((~x7)<<19); \
134
 
      x2 ^= x1; \
135
 
      x3 += x2; \
136
 
      x4 -= x3 ^ ((~x2)>>23); \
137
 
      x5 ^= x4; \
138
 
      x6 += x5; \
139
 
      x7 -= x6 ^ 0x0123456789ABCDEFLL;
 
208
        x0 -= x7 ^ XOR_CONST1; \
 
209
        x1 ^= x0; \
 
210
        x2 += x1;\
 
211
        x3 -= x2 ^ ((~x1)<<19);\
 
212
        x4 ^= x3;\
 
213
        x5 += x4;\
 
214
        x6 -= x5 ^ ((~x4)>>23); \
 
215
        x7 ^= x6; \
 
216
        x0 += x7; \
 
217
        x1 -= x0 ^ ((~x7)<<19); \
 
218
        x2 ^= x1; \
 
219
        x3 += x2; \
 
220
        x4 -= x3 ^ ((~x2)>>23); \
 
221
        x5 ^= x4; \
 
222
        x6 += x5; \
 
223
        x7 -= x6 ^ XOR_CONST2;
 
224
 
 
225
#define pass5n(a,b,c) \
 
226
          round5(a,b,c,x0) \
 
227
        x0 -= x7 ^ XOR_CONST1; \
 
228
          round5(b,c,a,x1) \
 
229
        x1 ^= x0; \
 
230
          round5(c,a,b,x2) \
 
231
        x2 += x1; \
 
232
          round5(a,b,c,x3) \
 
233
        x3 -= x2 ^ ((~x1)<<19); \
 
234
          round5(b,c,a,x4) \
 
235
        x4 ^= x3; \
 
236
          round5(c,a,b,x5) \
 
237
        x5 += x4; \
 
238
          round5(a,b,c,x6) \
 
239
        x6 -= x5 ^ ((~x4)>>23); \
 
240
          round5(b,c,a,x7) \
 
241
        x7 ^= x6; \
 
242
        x0 += x7; \
 
243
        x1 -= x0 ^ ((~x7)<<19); \
 
244
        x2 ^= x1; \
 
245
        x3 += x2; \
 
246
        x4 -= x3 ^ ((~x2)>>23); \
 
247
        x5 ^= x4; \
 
248
        x6 += x5; \
 
249
        x7 -= x6 ^ XOR_CONST2;
 
250
 
 
251
#define pass7n(a,b,c) \
 
252
          round7(a,b,c,x0) \
 
253
        x0 -= x7 ^ XOR_CONST1; \
 
254
          round7(b,c,a,x1) \
 
255
        x1 ^= x0; \
 
256
          round7(c,a,b,x2) \
 
257
        x2 += x1; \
 
258
          round7(a,b,c,x3) \
 
259
        x3 -= x2 ^ ((~x1)<<19); \
 
260
          round7(b,c,a,x4) \
 
261
        x4 ^= x3; \
 
262
          round7(c,a,b,x5) \
 
263
        x5 += x4; \
 
264
          round7(a,b,c,x6) \
 
265
        x6 -= x5 ^ ((~x4)>>23); \
 
266
          round7(b,c,a,x7) \
 
267
        x7 ^= x6; \
 
268
        x0 += x7; \
 
269
        x1 -= x0 ^ ((~x7)<<19); \
 
270
        x2 ^= x1; \
 
271
        x3 += x2; \
 
272
        x4 -= x3 ^ ((~x2)>>23); \
 
273
        x5 ^= x4; \
 
274
        x6 += x5; \
 
275
        x7 -= x6 ^ XOR_CONST2;
 
276
 
 
277
#define pass5(a,b,c) \
 
278
        pass_start \
 
279
          round5(a,b,c,x0) \
 
280
          round5(b,c,a,x1) \
 
281
          round5(c,a,b,x2) \
 
282
          round5(a,b,c,x3) \
 
283
          round5(b,c,a,x4) \
 
284
          round5(c,a,b,x5) \
 
285
          round5(a,b,c,x6) \
 
286
          round5(b,c,a,x7) \
 
287
        pass_end
 
288
 
 
289
#define pass7(a,b,c) \
 
290
        pass_start \
 
291
          round7(a,b,c,x0) \
 
292
          round7(b,c,a,x1) \
 
293
          round7(c,a,b,x2) \
 
294
          round7(a,b,c,x3) \
 
295
          round7(b,c,a,x4) \
 
296
          round7(c,a,b,x5) \
 
297
          round7(a,b,c,x6) \
 
298
          round7(b,c,a,x7) \
 
299
        pass_end
 
300
 
 
301
 
 
302
#define pass9(a,b,c) \
 
303
        pass_start \
 
304
          round9(a,b,c,x0) \
 
305
          round9(b,c,a,x1) \
 
306
          round9(c,a,b,x2) \
 
307
          round9(a,b,c,x3) \
 
308
          round9(b,c,a,x4) \
 
309
          round9(c,a,b,x5) \
 
310
          round9(a,b,c,x6) \
 
311
          round9(b,c,a,x7) \
 
312
        pass_end
140
313
 
141
314
#define feedforward \
142
 
      a ^= aa; \
143
 
      b -= bb; \
144
 
      c += cc;
145
 
 
146
 
#ifdef OPTIMIZE_FOR_ALPHA
147
 
/* The loop is unrolled: works better on Alpha */
148
 
#define compress \
149
 
      save_abc \
150
 
      pass(a,b,c,5) \
151
 
      key_schedule \
152
 
      pass(c,a,b,7) \
153
 
      key_schedule \
154
 
      pass(b,c,a,9) \
155
 
      for(pass_no=3; pass_no<PASSES; pass_no++) { \
156
 
        key_schedule \
157
 
        pass(a,b,c,9) \
158
 
        tmpa=a; a=c; c=b; b=tmpa;} \
159
 
      feedforward
160
 
#else
161
 
/* loop: works better on PC and Sun (smaller cache?) */
162
 
#define compress \
163
 
      save_abc \
164
 
      for(pass_no=0; pass_no<PASSES; pass_no++) { \
165
 
        if(pass_no != 0) {key_schedule} \
166
 
        pass(a,b,c,(pass_no==0?5:pass_no==1?7:9)); \
167
 
        tmpa=a; a=c; c=b; b=tmpa;} \
168
 
      feedforward
169
 
#endif
 
315
          a ^= aa; \
 
316
          b -= bb; \
 
317
          c += cc;
 
318
 
 
319
 
 
320
/* This version works ok with C variant and also with new asm version 
 
321
 * that just wastes a register r8 
 
322
 * reason? who knows, write forwarding is faster than keeping value 
 
323
 * in register? :) 
 
324
 */
 
325
#define compress \
 
326
        save_abc \
 
327
          pass5n(a,b,c) \
 
328
          pass7n(c,a,b) \
 
329
          pass9(b,c,a) \
 
330
          for(pass_no=3; pass_no<PASSES; pass_no++) { \
 
331
                key_schedule \
 
332
                pass9(a,b,c) \
 
333
                tmpa=a; a=c; c=b; b=tmpa; \
 
334
          } \
 
335
        feedforward
 
336
 
 
337
#define compress_old \
 
338
        save_abc \
 
339
          pass5(a,b,c) \
 
340
          key_schedule \
 
341
          pass7(c,a,b) \
 
342
          key_schedule \
 
343
          pass9(b,c,a) \
 
344
          for(pass_no=3; pass_no<PASSES; pass_no++) { \
 
345
                key_schedule \
 
346
                pass9(a,b,c) \
 
347
                tmpa=a; a=c; c=b; b=tmpa; \
 
348
          } \
 
349
        feedforward
170
350
 
171
351
#define tiger_compress_macro(str, state) \
172
352
{ \
173
 
  register word64 a, b, c, tmpa; \
 
353
  register word64 a, b, c; \
 
354
  register word64 tmpa; \
174
355
  word64 aa, bb, cc; \
175
 
  register word64 x0, x1, x2, x3, x4, x5, x6, x7; \
 
356
  word64 x0, x1, x2, x3, x4, x5, x6, x7; \
176
357
  int pass_no; \
177
358
\
178
359
  a = state[0]; \
189
370
  state[2] = c; \
190
371
}
191
372
 
192
 
/* The compress function is a function. Requires smaller cache?    */
193
373
void tiger_compress(word64 *str, word64 state[3])
194
374
{
195
 
#ifndef S_SPLINT_S
196
375
  tiger_compress_macro(((word64*)str), ((word64*)state));
197
 
#endif
198
376
}
199
377
 
200
 
#ifdef OPTIMIZE_FOR_ALPHA
201
 
/* The compress function is inlined: works better on Alpha.        */
202
 
/* Still leaves the function above in the code, in case some other */
203
 
/* module calls it directly.                                       */
204
 
#define tiger_compress(str, state) \
205
 
  tiger_compress_macro(((word64*)str), ((word64*)state))
206
 
#endif
207
 
 
208
378
void tiger_t(word64 *str, word64 length, word64 res[3])
209
379
{
210
380
  register word64 i;
215
385
#endif
216
386
 
217
387
  /*
218
 
    res[0]=0x0123456789ABCDEFLL;
219
 
    res[1]=0xFEDCBA9876543210LL;
220
 
    res[2]=0xF096A5B4C3B2E187LL;
221
 
  */
 
388
   * res[0]=0x0123456789ABCDEFLL;
 
389
   * res[1]=0xFEDCBA9876543210LL;
 
390
   * res[2]=0xF096A5B4C3B2E187LL;
 
391
   */
222
392
 
223
393
  for(i=length; i>=64; i-=64)
224
394
    {
225
395
#ifdef BIG_ENDIAN
226
396
      for(j=0; j<64; j++)
227
 
        temp[j^7] = ((sh_byte*)str)[j];
 
397
        temp[j^7] = ((sh_byte*)str)[j];
228
398
      tiger_compress(((word64*)temp), res);
229
399
#else
230
400
      tiger_compress(str, res);
231
401
#endif
232
402
      str += 8;
233
403
    }
234
 
 
235
404
}
236
405
 
237
406
void tiger(word64 *str, word64 length, word64 res[3])
241
410
  unsigned char temp[64];
242
411
 
243
412
  /*
244
 
    res[0]=0x0123456789ABCDEFLL;
245
 
    res[1]=0xFEDCBA9876543210LL;
246
 
    res[2]=0xF096A5B4C3B2E187LL;
247
 
  */
 
413
   * res[0]=0x0123456789ABCDEFLL;
 
414
   * res[1]=0xFEDCBA9876543210LL;
 
415
   * res[2]=0xF096A5B4C3B2E187LL;
 
416
   */
248
417
 
249
418
  for(i=length; i>=64; i-=64)
250
419
    {
251
420
#ifdef BIG_ENDIAN
252
421
      for(j=0; j<64; j++)
253
 
        temp[j^7] = ((sh_byte*)str)[j];
 
422
        temp[j^7] = ((sh_byte*)str)[j];
254
423
      tiger_compress(((word64*)temp), res);
255
424
#else
256
425
      tiger_compress(str, res);
267
436
  for(; j&7; j++)
268
437
    temp[j^7] = 0;
269
438
#else
 
439
 
 
440
#ifndef USE_MEMSET
270
441
  for(j=0; j<i; j++)
271
442
    temp[j] = ((sh_byte*)str)[j];
272
 
 
 
443
#else
 
444
  memcpy( temp, str, j=i );
 
445
#endif
273
446
  temp[j++] = 0x01;
274
447
  for(; j&7; j++)
275
 
    temp[j] = 0;
 
448
        temp[j] = 0;
 
449
 
276
450
#endif
 
451
 
277
452
  if(j>56)
278
453
    {
 
454
#ifndef USE_MEMSET
279
455
      for(; j<64; j++)
280
456
        temp[j] = 0;
 
457
#else
 
458
      memset( temp+j, 0, 64-j);
 
459
#endif
281
460
      tiger_compress(((word64*)temp), res);
282
461
      j=0;
283
462
    }
284
463
 
 
464
#ifndef USE_MEMSET
285
465
  for(; j<56; j++)
286
466
    temp[j] = 0;
 
467
#else
 
468
  memset( temp+j, 0, 56-j);
 
469
#endif
 
470
 
287
471
  ((word64*)(&(temp[56])))[0] = ((word64)length)<<3;
288
472
  tiger_compress(((word64*)temp), res);
289
473
}
290
474
 
291
 
#else
292
 
 
293
 
void dummy_1_64 (int a)
294
 
{
295
 
  return;
296
 
}
297
 
 
298
475
#endif
299
 
 
300
 
 
301
 
 
302
 
 
303
 
 
304
 
 
305
 
 
306
 
 
307