Lines Matching refs:ctx

176 	(ctx->block[(n)] = \
182 (ctx->block[(n)])
189 static const void *body(PHP_MD5_CTX *ctx, const void *data, size_t size) in body() argument
197 a = ctx->a; in body()
198 b = ctx->b; in body()
199 c = ctx->c; in body()
200 d = ctx->d; in body()
288 ctx->a = a; in body()
289 ctx->b = b; in body()
290 ctx->c = c; in body()
291 ctx->d = d; in body()
296 PHPAPI void PHP_MD5Init(PHP_MD5_CTX *ctx) in PHP_MD5Init() argument
298 ctx->a = 0x67452301; in PHP_MD5Init()
299 ctx->b = 0xefcdab89; in PHP_MD5Init()
300 ctx->c = 0x98badcfe; in PHP_MD5Init()
301 ctx->d = 0x10325476; in PHP_MD5Init()
303 ctx->lo = 0; in PHP_MD5Init()
304 ctx->hi = 0; in PHP_MD5Init()
307 PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size) in PHP_MD5Update() argument
312 saved_lo = ctx->lo; in PHP_MD5Update()
313 if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { in PHP_MD5Update()
314 ctx->hi++; in PHP_MD5Update()
316 ctx->hi += size >> 29; in PHP_MD5Update()
324 memcpy(&ctx->buffer[used], data, size); in PHP_MD5Update()
328 memcpy(&ctx->buffer[used], data, free); in PHP_MD5Update()
331 body(ctx, ctx->buffer, 64); in PHP_MD5Update()
335 data = body(ctx, data, size & ~(size_t)0x3f); in PHP_MD5Update()
339 memcpy(ctx->buffer, data, size); in PHP_MD5Update()
342 PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx) in PHP_MD5Final() argument
346 used = ctx->lo & 0x3f; in PHP_MD5Final()
348 ctx->buffer[used++] = 0x80; in PHP_MD5Final()
353 memset(&ctx->buffer[used], 0, free); in PHP_MD5Final()
354 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
359 memset(&ctx->buffer[used], 0, free - 8); in PHP_MD5Final()
361 ctx->lo <<= 3; in PHP_MD5Final()
362 ctx->buffer[56] = ctx->lo; in PHP_MD5Final()
363 ctx->buffer[57] = ctx->lo >> 8; in PHP_MD5Final()
364 ctx->buffer[58] = ctx->lo >> 16; in PHP_MD5Final()
365 ctx->buffer[59] = ctx->lo >> 24; in PHP_MD5Final()
366 ctx->buffer[60] = ctx->hi; in PHP_MD5Final()
367 ctx->buffer[61] = ctx->hi >> 8; in PHP_MD5Final()
368 ctx->buffer[62] = ctx->hi >> 16; in PHP_MD5Final()
369 ctx->buffer[63] = ctx->hi >> 24; in PHP_MD5Final()
371 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
373 result[0] = ctx->a; in PHP_MD5Final()
374 result[1] = ctx->a >> 8; in PHP_MD5Final()
375 result[2] = ctx->a >> 16; in PHP_MD5Final()
376 result[3] = ctx->a >> 24; in PHP_MD5Final()
377 result[4] = ctx->b; in PHP_MD5Final()
378 result[5] = ctx->b >> 8; in PHP_MD5Final()
379 result[6] = ctx->b >> 16; in PHP_MD5Final()
380 result[7] = ctx->b >> 24; in PHP_MD5Final()
381 result[8] = ctx->c; in PHP_MD5Final()
382 result[9] = ctx->c >> 8; in PHP_MD5Final()
383 result[10] = ctx->c >> 16; in PHP_MD5Final()
384 result[11] = ctx->c >> 24; in PHP_MD5Final()
385 result[12] = ctx->d; in PHP_MD5Final()
386 result[13] = ctx->d >> 8; in PHP_MD5Final()
387 result[14] = ctx->d >> 16; in PHP_MD5Final()
388 result[15] = ctx->d >> 24; in PHP_MD5Final()
390 ZEND_SECURE_ZERO(ctx, sizeof(*ctx)); in PHP_MD5Final()