Lines Matching refs:ctx
91 static CURLcode my_md5_init(void *ctx) in my_md5_init() argument
93 md5_init(ctx); in my_md5_init()
97 static void my_md5_update(void *ctx, in my_md5_update() argument
101 md5_update(ctx, inputLen, input); in my_md5_update()
104 static void my_md5_final(unsigned char *digest, void *ctx) in my_md5_final() argument
106 md5_digest(ctx, 16, digest); in my_md5_final()
113 static CURLcode my_md5_init(void *ctx) in my_md5_init() argument
115 if(!MD5_Init(ctx)) in my_md5_init()
121 static void my_md5_update(void *ctx, in my_md5_update() argument
125 (void)MD5_Update(ctx, input, len); in my_md5_update()
128 static void my_md5_final(unsigned char *digest, void *ctx) in my_md5_final() argument
130 (void)MD5_Final(digest, ctx); in my_md5_final()
137 static CURLcode my_md5_init(void *ctx) in my_md5_init() argument
140 if(mbedtls_md5_starts(ctx)) in my_md5_init()
143 if(mbedtls_md5_starts_ret(ctx)) in my_md5_init()
146 (void)mbedtls_md5_starts(ctx); in my_md5_init()
151 static void my_md5_update(void *ctx, in my_md5_update() argument
156 (void) mbedtls_md5_update(ctx, data, length); in my_md5_update()
158 (void) mbedtls_md5_update_ret(ctx, data, length); in my_md5_update()
162 static void my_md5_final(unsigned char *digest, void *ctx) in my_md5_final() argument
165 (void) mbedtls_md5_finish(ctx, digest); in my_md5_final()
167 (void) mbedtls_md5_finish_ret(ctx, digest); in my_md5_final()
181 static CURLcode my_md5_init(void *ctx) in my_md5_init() argument
183 if(!CC_MD5_Init(ctx)) in my_md5_init()
189 static void my_md5_update(void *ctx, in my_md5_update() argument
193 CC_MD5_Update(ctx, input, inputLen); in my_md5_update()
196 static void my_md5_final(unsigned char *digest, void *ctx) in my_md5_final() argument
198 CC_MD5_Final(digest, ctx); in my_md5_final()
211 my_md5_ctx *ctx = (my_md5_ctx *)in; in my_md5_init() local
212 if(!CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_FULL, in my_md5_init()
216 if(!CryptCreateHash(ctx->hCryptProv, CALG_MD5, 0, 0, &ctx->hHash)) { in my_md5_init()
217 CryptReleaseContext(ctx->hCryptProv, 0); in my_md5_init()
218 ctx->hCryptProv = 0; in my_md5_init()
229 my_md5_ctx *ctx = in; in my_md5_update() local
230 CryptHashData(ctx->hHash, (unsigned char *)input, inputLen, 0); in my_md5_update()
235 my_md5_ctx *ctx = (my_md5_ctx *)in; in my_md5_final() local
237 CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); in my_md5_final()
239 CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0); in my_md5_final()
240 if(ctx->hHash) in my_md5_final()
241 CryptDestroyHash(ctx->hHash); in my_md5_final()
242 if(ctx->hCryptProv) in my_md5_final()
243 CryptReleaseContext(ctx->hCryptProv, 0); in my_md5_final()
298 static CURLcode my_md5_init(void *ctx);
299 static void my_md5_update(void *ctx, const unsigned char *data,
301 static void my_md5_final(unsigned char *result, void *ctx);
339 (ctx->block[(n)] = \
345 (ctx->block[(n)])
352 static const void *my_md5_body(my_md5_ctx *ctx, in my_md5_body() argument
360 a = ctx->a; in my_md5_body()
361 b = ctx->b; in my_md5_body()
362 c = ctx->c; in my_md5_body()
363 d = ctx->d; in my_md5_body()
453 ctx->a = a; in my_md5_body()
454 ctx->b = b; in my_md5_body()
455 ctx->c = c; in my_md5_body()
456 ctx->d = d; in my_md5_body()
463 my_md5_ctx *ctx = (my_md5_ctx *)in; in my_md5_init() local
464 ctx->a = 0x67452301; in my_md5_init()
465 ctx->b = 0xefcdab89; in my_md5_init()
466 ctx->c = 0x98badcfe; in my_md5_init()
467 ctx->d = 0x10325476; in my_md5_init()
469 ctx->lo = 0; in my_md5_init()
470 ctx->hi = 0; in my_md5_init()
480 my_md5_ctx *ctx = (my_md5_ctx *)in; in my_md5_update() local
482 saved_lo = ctx->lo; in my_md5_update()
483 ctx->lo = (saved_lo + size) & 0x1fffffff; in my_md5_update()
484 if(ctx->lo < saved_lo) in my_md5_update()
485 ctx->hi++; in my_md5_update()
486 ctx->hi += (MD5_u32plus)size >> 29; in my_md5_update()
494 memcpy(&ctx->buffer[used], data, size); in my_md5_update()
498 memcpy(&ctx->buffer[used], data, available); in my_md5_update()
501 my_md5_body(ctx, ctx->buffer, 64); in my_md5_update()
505 data = my_md5_body(ctx, data, size & ~(unsigned long)0x3f); in my_md5_update()
509 memcpy(ctx->buffer, data, size); in my_md5_update()
515 my_md5_ctx *ctx = (my_md5_ctx *)in; in my_md5_final() local
517 used = ctx->lo & 0x3f; in my_md5_final()
519 ctx->buffer[used++] = 0x80; in my_md5_final()
524 memset(&ctx->buffer[used], 0, available); in my_md5_final()
525 my_md5_body(ctx, ctx->buffer, 64); in my_md5_final()
530 memset(&ctx->buffer[used], 0, available - 8); in my_md5_final()
532 ctx->lo <<= 3; in my_md5_final()
533 ctx->buffer[56] = curlx_ultouc((ctx->lo)&0xff); in my_md5_final()
534 ctx->buffer[57] = curlx_ultouc((ctx->lo >> 8)&0xff); in my_md5_final()
535 ctx->buffer[58] = curlx_ultouc((ctx->lo >> 16)&0xff); in my_md5_final()
536 ctx->buffer[59] = curlx_ultouc(ctx->lo >> 24); in my_md5_final()
537 ctx->buffer[60] = curlx_ultouc((ctx->hi)&0xff); in my_md5_final()
538 ctx->buffer[61] = curlx_ultouc((ctx->hi >> 8)&0xff); in my_md5_final()
539 ctx->buffer[62] = curlx_ultouc((ctx->hi >> 16)&0xff); in my_md5_final()
540 ctx->buffer[63] = curlx_ultouc(ctx->hi >> 24); in my_md5_final()
542 my_md5_body(ctx, ctx->buffer, 64); in my_md5_final()
544 result[0] = curlx_ultouc((ctx->a)&0xff); in my_md5_final()
545 result[1] = curlx_ultouc((ctx->a >> 8)&0xff); in my_md5_final()
546 result[2] = curlx_ultouc((ctx->a >> 16)&0xff); in my_md5_final()
547 result[3] = curlx_ultouc(ctx->a >> 24); in my_md5_final()
548 result[4] = curlx_ultouc((ctx->b)&0xff); in my_md5_final()
549 result[5] = curlx_ultouc((ctx->b >> 8)&0xff); in my_md5_final()
550 result[6] = curlx_ultouc((ctx->b >> 16)&0xff); in my_md5_final()
551 result[7] = curlx_ultouc(ctx->b >> 24); in my_md5_final()
552 result[8] = curlx_ultouc((ctx->c)&0xff); in my_md5_final()
553 result[9] = curlx_ultouc((ctx->c >> 8)&0xff); in my_md5_final()
554 result[10] = curlx_ultouc((ctx->c >> 16)&0xff); in my_md5_final()
555 result[11] = curlx_ultouc(ctx->c >> 24); in my_md5_final()
556 result[12] = curlx_ultouc((ctx->d)&0xff); in my_md5_final()
557 result[13] = curlx_ultouc((ctx->d >> 8)&0xff); in my_md5_final()
558 result[14] = curlx_ultouc((ctx->d >> 16)&0xff); in my_md5_final()
559 result[15] = curlx_ultouc(ctx->d >> 24); in my_md5_final()
561 memset(ctx, 0, sizeof(*ctx)); in my_md5_final()
591 my_md5_ctx ctx; in Curl_md5it() local
593 result = my_md5_init(&ctx); in Curl_md5it()
595 my_md5_update(&ctx, input, curlx_uztoui(len)); in Curl_md5it()
596 my_md5_final(outbuffer, &ctx); in Curl_md5it()