• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/libgcrypt-1.5.0/cipher/

Lines Matching refs:hd

70   SHA1_CONTEXT *hd = context;
72 hd->h0 = 0x67452301;
73 hd->h1 = 0xefcdab89;
74 hd->h2 = 0x98badcfe;
75 hd->h3 = 0x10325476;
76 hd->h4 = 0xc3d2e1f0;
77 hd->nblocks = 0;
78 hd->count = 0;
108 transform (SHA1_CONTEXT *hd, const unsigned char *data, size_t nblocks)
135 a = hd->h0;
136 b = hd->h1;
137 c = hd->h2;
138 d = hd->h3;
139 e = hd->h4;
224 hd->h0 += a;
225 hd->h1 += b;
226 hd->h2 += c;
227 hd->h3 += d;
228 hd->h4 += e;
240 SHA1_CONTEXT *hd = context;
243 if (hd->count == 64) /* Flush the buffer. */
245 TRANSFORM( hd, hd->buf, 1 );
247 hd->count = 0;
248 hd->nblocks++;
253 if (hd->count)
255 for (; inlen && hd->count < 64; inlen--)
256 hd->buf[hd->count++] = *inbuf++;
257 sha1_write (hd, NULL, 0);
265 TRANSFORM (hd, inbuf, nblocks);
266 hd->count = 0;
267 hd->nblocks += nblocks;
274 for (; inlen && hd->count < 64; inlen--)
275 hd->buf[hd->count++] = *inbuf++;
289 SHA1_CONTEXT *hd = context;
294 sha1_write(hd, NULL, 0); /* flush */;
296 t = hd->nblocks;
302 if( (lsb += hd->count) < t )
310 if( hd->count < 56 ) /* enough room */
312 hd->buf[hd->count++] = 0x80; /* pad */
313 while( hd->count < 56 )
314 hd->buf[hd->count++] = 0; /* pad */
318 hd->buf[hd->count++] = 0x80; /* pad character */
319 while( hd->count < 64 )
320 hd->buf[hd->count++] = 0;
321 sha1_write(hd, NULL, 0); /* flush */;
322 memset(hd->buf, 0, 56 ); /* fill next block with zeroes */
325 hd->buf[56] = msb >> 24;
326 hd->buf[57] = msb >> 16;
327 hd->buf[58] = msb >> 8;
328 hd->buf[59] = msb ;
329 hd->buf[60] = lsb >> 24;
330 hd->buf[61] = lsb >> 16;
331 hd->buf[62] = lsb >> 8;
332 hd->buf[63] = lsb ;
333 TRANSFORM( hd, hd->buf, 1 );
336 p = hd->buf;
338 #define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
340 #define X(a) do { *p++ = hd->h##a >> 24; *p++ = hd->h##a >> 16; \
341 *p++ = hd->h##a >> 8; *p++ = hd->h##a; } while(0)
355 SHA1_CONTEXT *hd = context;
357 return hd->buf;
367 SHA1_CONTEXT hd;
369 sha1_init (&hd);
370 sha1_write (&hd, buffer, length);
371 sha1_final (&hd);
372 memcpy (outbuf, hd.buf, 20);