Lines Matching refs:ctx

173 	(ctx->block[(n)] = \
179 (ctx->block[(n)])
186 static const void *body(PHP_MD5_CTX *ctx, const void *data, size_t size) in body() argument
194 a = ctx->a; in body()
195 b = ctx->b; in body()
196 c = ctx->c; in body()
197 d = ctx->d; in body()
285 ctx->a = a; in body()
286 ctx->b = b; in body()
287 ctx->c = c; in body()
288 ctx->d = d; in body()
293 PHPAPI void PHP_MD5Init(PHP_MD5_CTX *ctx) in PHP_MD5Init() argument
295 ctx->a = 0x67452301; in PHP_MD5Init()
296 ctx->b = 0xefcdab89; in PHP_MD5Init()
297 ctx->c = 0x98badcfe; in PHP_MD5Init()
298 ctx->d = 0x10325476; in PHP_MD5Init()
300 ctx->lo = 0; in PHP_MD5Init()
301 ctx->hi = 0; in PHP_MD5Init()
304 PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size) in PHP_MD5Update() argument
309 saved_lo = ctx->lo; in PHP_MD5Update()
310 if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { in PHP_MD5Update()
311 ctx->hi++; in PHP_MD5Update()
313 ctx->hi += size >> 29; in PHP_MD5Update()
321 memcpy(&ctx->buffer[used], data, size); in PHP_MD5Update()
325 memcpy(&ctx->buffer[used], data, free); in PHP_MD5Update()
328 body(ctx, ctx->buffer, 64); in PHP_MD5Update()
332 data = body(ctx, data, size & ~(size_t)0x3f); in PHP_MD5Update()
336 memcpy(ctx->buffer, data, size); in PHP_MD5Update()
339 PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx) in PHP_MD5Final() argument
343 used = ctx->lo & 0x3f; in PHP_MD5Final()
345 ctx->buffer[used++] = 0x80; in PHP_MD5Final()
350 memset(&ctx->buffer[used], 0, free); in PHP_MD5Final()
351 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
356 memset(&ctx->buffer[used], 0, free - 8); in PHP_MD5Final()
358 ctx->lo <<= 3; in PHP_MD5Final()
359 ctx->buffer[56] = ctx->lo; in PHP_MD5Final()
360 ctx->buffer[57] = ctx->lo >> 8; in PHP_MD5Final()
361 ctx->buffer[58] = ctx->lo >> 16; in PHP_MD5Final()
362 ctx->buffer[59] = ctx->lo >> 24; in PHP_MD5Final()
363 ctx->buffer[60] = ctx->hi; in PHP_MD5Final()
364 ctx->buffer[61] = ctx->hi >> 8; in PHP_MD5Final()
365 ctx->buffer[62] = ctx->hi >> 16; in PHP_MD5Final()
366 ctx->buffer[63] = ctx->hi >> 24; in PHP_MD5Final()
368 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
370 result[0] = ctx->a; in PHP_MD5Final()
371 result[1] = ctx->a >> 8; in PHP_MD5Final()
372 result[2] = ctx->a >> 16; in PHP_MD5Final()
373 result[3] = ctx->a >> 24; in PHP_MD5Final()
374 result[4] = ctx->b; in PHP_MD5Final()
375 result[5] = ctx->b >> 8; in PHP_MD5Final()
376 result[6] = ctx->b >> 16; in PHP_MD5Final()
377 result[7] = ctx->b >> 24; in PHP_MD5Final()
378 result[8] = ctx->c; in PHP_MD5Final()
379 result[9] = ctx->c >> 8; in PHP_MD5Final()
380 result[10] = ctx->c >> 16; in PHP_MD5Final()
381 result[11] = ctx->c >> 24; in PHP_MD5Final()
382 result[12] = ctx->d; in PHP_MD5Final()
383 result[13] = ctx->d >> 8; in PHP_MD5Final()
384 result[14] = ctx->d >> 16; in PHP_MD5Final()
385 result[15] = ctx->d >> 24; in PHP_MD5Final()
387 ZEND_SECURE_ZERO(ctx, sizeof(*ctx)); in PHP_MD5Final()