• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7800-V1.0.2.28/tools/firmware-utils/src/

Lines Matching defs:ctx

60 void sha1_starts( sha1_context *ctx )
62 ctx->total[0] = 0;
63 ctx->total[1] = 0;
65 ctx->state[0] = 0x67452301;
66 ctx->state[1] = 0xEFCDAB89;
67 ctx->state[2] = 0x98BADCFE;
68 ctx->state[3] = 0x10325476;
69 ctx->state[4] = 0xC3D2E1F0;
72 void sha1_process( sha1_context *ctx, uchar data[64] )
107 A = ctx->state[0];
108 B = ctx->state[1];
109 C = ctx->state[2];
110 D = ctx->state[3];
111 E = ctx->state[4];
221 ctx->state[0] += A;
222 ctx->state[1] += B;
223 ctx->state[2] += C;
224 ctx->state[3] += D;
225 ctx->state[4] += E;
228 void sha1_update( sha1_context *ctx, uchar *input, uint length )
234 left = ctx->total[0] & 0x3F;
237 ctx->total[0] += length;
238 ctx->total[0] &= 0xFFFFFFFF;
240 if( ctx->total[0] < length )
241 ctx->total[1]++;
245 memcpy( (void *) (ctx->buffer + left),
247 sha1_process( ctx, ctx->buffer );
255 sha1_process( ctx, input );
262 memcpy( (void *) (ctx->buffer + left),
275 void sha1_finish( sha1_context *ctx, uchar digest[20] )
281 high = ( ctx->total[0] >> 29 )
282 | ( ctx->total[1] << 3 );
283 low = ( ctx->total[0] << 3 );
288 last = ctx->total[0] & 0x3F;
291 sha1_update( ctx, sha1_padding, padn );
292 sha1_update( ctx, msglen, 8 );
294 PUT_UINT32_BE( ctx->state[0], digest, 0 );
295 PUT_UINT32_BE( ctx->state[1], digest, 4 );
296 PUT_UINT32_BE( ctx->state[2], digest, 8 );
297 PUT_UINT32_BE( ctx->state[3], digest, 12 );
298 PUT_UINT32_BE( ctx->state[4], digest, 16 );
308 sha1_context ctx;
314 sha1_starts( &ctx );
317 sha1_update( &ctx, buf, (uint) n );
319 sha1_finish( &ctx, digest );
330 sha1_context ctx;
332 sha1_starts( &ctx );
333 sha1_update( &ctx, buf, buflen );
334 sha1_finish( &ctx, digest );
344 sha1_context ctx;
360 sha1_starts( &ctx );
361 sha1_update( &ctx, k_ipad, 64 );
362 sha1_update( &ctx, buf, buflen );
363 sha1_finish( &ctx, tmpbuf );
365 sha1_starts( &ctx );
366 sha1_update( &ctx, k_opad, 64 );
367 sha1_update( &ctx, tmpbuf, 20 );
368 sha1_finish( &ctx, digest );
373 memset( &ctx, 0, sizeof( sha1_context ) );
405 sha1_context ctx;
411 sha1_starts( &ctx );
414 sha1_update( &ctx, (uchar *) sha1_test_str[i],
420 sha1_update( &ctx, (uchar *) buf, 1000 );
423 sha1_finish( &ctx, sha1sum );