Lines Matching refs:ctx
177 (ctx->block[(n)] = \
183 (ctx->block[(n)])
190 static const void *body(PHP_MD5_CTX *ctx, const void *data, size_t size) in body() argument
198 a = ctx->a; in body()
199 b = ctx->b; in body()
200 c = ctx->c; in body()
201 d = ctx->d; in body()
289 ctx->a = a; in body()
290 ctx->b = b; in body()
291 ctx->c = c; in body()
292 ctx->d = d; in body()
297 PHPAPI void PHP_MD5Init(PHP_MD5_CTX *ctx) in PHP_MD5Init() argument
299 ctx->a = 0x67452301; in PHP_MD5Init()
300 ctx->b = 0xefcdab89; in PHP_MD5Init()
301 ctx->c = 0x98badcfe; in PHP_MD5Init()
302 ctx->d = 0x10325476; in PHP_MD5Init()
304 ctx->lo = 0; in PHP_MD5Init()
305 ctx->hi = 0; in PHP_MD5Init()
308 PHPAPI void PHP_MD5Update(PHP_MD5_CTX *ctx, const void *data, size_t size) in PHP_MD5Update() argument
313 saved_lo = ctx->lo; in PHP_MD5Update()
314 if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) { in PHP_MD5Update()
315 ctx->hi++; in PHP_MD5Update()
317 ctx->hi += size >> 29; in PHP_MD5Update()
325 memcpy(&ctx->buffer[used], data, size); in PHP_MD5Update()
329 memcpy(&ctx->buffer[used], data, free); in PHP_MD5Update()
332 body(ctx, ctx->buffer, 64); in PHP_MD5Update()
336 data = body(ctx, data, size & ~(size_t)0x3f); in PHP_MD5Update()
340 memcpy(ctx->buffer, data, size); in PHP_MD5Update()
343 PHPAPI void PHP_MD5Final(unsigned char *result, PHP_MD5_CTX *ctx) in PHP_MD5Final() argument
347 used = ctx->lo & 0x3f; in PHP_MD5Final()
349 ctx->buffer[used++] = 0x80; in PHP_MD5Final()
354 memset(&ctx->buffer[used], 0, free); in PHP_MD5Final()
355 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
360 memset(&ctx->buffer[used], 0, free - 8); in PHP_MD5Final()
362 ctx->lo <<= 3; in PHP_MD5Final()
363 ctx->buffer[56] = ctx->lo; in PHP_MD5Final()
364 ctx->buffer[57] = ctx->lo >> 8; in PHP_MD5Final()
365 ctx->buffer[58] = ctx->lo >> 16; in PHP_MD5Final()
366 ctx->buffer[59] = ctx->lo >> 24; in PHP_MD5Final()
367 ctx->buffer[60] = ctx->hi; in PHP_MD5Final()
368 ctx->buffer[61] = ctx->hi >> 8; in PHP_MD5Final()
369 ctx->buffer[62] = ctx->hi >> 16; in PHP_MD5Final()
370 ctx->buffer[63] = ctx->hi >> 24; in PHP_MD5Final()
372 body(ctx, ctx->buffer, 64); in PHP_MD5Final()
374 result[0] = ctx->a; in PHP_MD5Final()
375 result[1] = ctx->a >> 8; in PHP_MD5Final()
376 result[2] = ctx->a >> 16; in PHP_MD5Final()
377 result[3] = ctx->a >> 24; in PHP_MD5Final()
378 result[4] = ctx->b; in PHP_MD5Final()
379 result[5] = ctx->b >> 8; in PHP_MD5Final()
380 result[6] = ctx->b >> 16; in PHP_MD5Final()
381 result[7] = ctx->b >> 24; in PHP_MD5Final()
382 result[8] = ctx->c; in PHP_MD5Final()
383 result[9] = ctx->c >> 8; in PHP_MD5Final()
384 result[10] = ctx->c >> 16; in PHP_MD5Final()
385 result[11] = ctx->c >> 24; in PHP_MD5Final()
386 result[12] = ctx->d; in PHP_MD5Final()
387 result[13] = ctx->d >> 8; in PHP_MD5Final()
388 result[14] = ctx->d >> 16; in PHP_MD5Final()
389 result[15] = ctx->d >> 24; in PHP_MD5Final()
391 ZEND_SECURE_ZERO(ctx, sizeof(*ctx)); in PHP_MD5Final()