Lines Matching refs:ctx
174 (ctx->block[(n)] = \
180 (ctx->block[(n)])
187 static const void *body(PHP_MD5_CTX *ctx, const void *data, size_t size) in body() argument
195 a = ctx->a; in body()
196 b = ctx->b; in body()
197 c = ctx->c; in body()
198 d = ctx->d; in body()
286 ctx->a = a; in body()
287 ctx->b = b; in body()
288 ctx->c = c; in body()
289 ctx->d = d; in body()
294 PHPAPI void PHP_MD5Init(PHP_MD5_CTX *ctx) in PHP_MD5Init() argument
296 ctx->a = 0x67452301; in PHP_MD5Init()
297 ctx->b = 0xefcdab89; in PHP_MD5Init()
298 ctx->c = 0x98badcfe; in PHP_MD5Init()
299 ctx->d = 0x10325476; in PHP_MD5Init()
301 ctx->lo = 0; in PHP_MD5Init()
302 ctx->hi = 0; in PHP_MD5Init()
305 PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size) in PHP_MD5Update() argument
310 saved_lo = ctx->lo; in PHP_MD5Update()
311 if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { in PHP_MD5Update()
312 ctx->hi++; in PHP_MD5Update()
314 ctx->hi += size >> 29; in PHP_MD5Update()
322 memcpy(&ctx->buffer[used], data, size); in PHP_MD5Update()
326 memcpy(&ctx->buffer[used], data, free); in PHP_MD5Update()
329 body(ctx, ctx->buffer, 64); in PHP_MD5Update()
333 data = body(ctx, data, size & ~(size_t)0x3f); in PHP_MD5Update()
337 memcpy(ctx->buffer, data, size); in PHP_MD5Update()
340 PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx) in PHP_MD5Final() argument
344 used = ctx->lo & 0x3f; in PHP_MD5Final()
346 ctx->buffer[used++] = 0x80; in PHP_MD5Final()
351 memset(&ctx->buffer[used], 0, free); in PHP_MD5Final()
352 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
357 memset(&ctx->buffer[used], 0, free - 8); in PHP_MD5Final()
359 ctx->lo <<= 3; in PHP_MD5Final()
360 ctx->buffer[56] = ctx->lo; in PHP_MD5Final()
361 ctx->buffer[57] = ctx->lo >> 8; in PHP_MD5Final()
362 ctx->buffer[58] = ctx->lo >> 16; in PHP_MD5Final()
363 ctx->buffer[59] = ctx->lo >> 24; in PHP_MD5Final()
364 ctx->buffer[60] = ctx->hi; in PHP_MD5Final()
365 ctx->buffer[61] = ctx->hi >> 8; in PHP_MD5Final()
366 ctx->buffer[62] = ctx->hi >> 16; in PHP_MD5Final()
367 ctx->buffer[63] = ctx->hi >> 24; in PHP_MD5Final()
369 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
371 result[0] = ctx->a; in PHP_MD5Final()
372 result[1] = ctx->a >> 8; in PHP_MD5Final()
373 result[2] = ctx->a >> 16; in PHP_MD5Final()
374 result[3] = ctx->a >> 24; in PHP_MD5Final()
375 result[4] = ctx->b; in PHP_MD5Final()
376 result[5] = ctx->b >> 8; in PHP_MD5Final()
377 result[6] = ctx->b >> 16; in PHP_MD5Final()
378 result[7] = ctx->b >> 24; in PHP_MD5Final()
379 result[8] = ctx->c; in PHP_MD5Final()
380 result[9] = ctx->c >> 8; in PHP_MD5Final()
381 result[10] = ctx->c >> 16; in PHP_MD5Final()
382 result[11] = ctx->c >> 24; in PHP_MD5Final()
383 result[12] = ctx->d; in PHP_MD5Final()
384 result[13] = ctx->d >> 8; in PHP_MD5Final()
385 result[14] = ctx->d >> 16; in PHP_MD5Final()
386 result[15] = ctx->d >> 24; in PHP_MD5Final()
388 memset(ctx, 0, sizeof(*ctx)); in PHP_MD5Final()