Lines Matching refs:ctx
119 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_init() local
121 *ctx = EVP_MD_CTX_create(); in Curl_sha512_256_init()
122 if(!*ctx) in Curl_sha512_256_init()
125 if(EVP_DigestInit_ex(*ctx, EVP_sha512_256(), NULL)) { in Curl_sha512_256_init()
127 DEBUGASSERT(EVP_MD_CTX_size(*ctx) == CURL_SHA512_256_DIGEST_SIZE); in Curl_sha512_256_init()
129 DEBUGASSERT(EVP_MD_CTX_block_size(*ctx) == CURL_SHA512_256_BLOCK_SIZE); in Curl_sha512_256_init()
135 EVP_MD_CTX_destroy(*ctx); in Curl_sha512_256_init()
153 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_update() local
155 if(!EVP_DigestUpdate(*ctx, data, length)) in Curl_sha512_256_update()
176 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_finish() local
182 ret = EVP_DigestFinal_ex(*ctx, in Curl_sha512_256_finish()
188 ret = EVP_DigestFinal_ex(*ctx, digest, NULL) ? CURLE_OK : CURLE_SSL_CIPHER; in Curl_sha512_256_finish()
191 EVP_MD_CTX_destroy(*ctx); in Curl_sha512_256_finish()
192 *ctx = NULL; in Curl_sha512_256_finish()
216 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_init() local
221 sha512_256_init(ctx); in Curl_sha512_256_init()
240 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_update() local
244 sha512_256_update(ctx, length, (const uint8_t *)data); in Curl_sha512_256_update()
262 Curl_sha512_256_ctx *const ctx = (Curl_sha512_256_ctx *)context; in Curl_sha512_256_finish() local
264 sha512_256_digest(ctx, in Curl_sha512_256_finish()
431 struct mhdx_sha512_256ctx *const ctx = (struct mhdx_sha512_256ctx *) context; in MHDx_sha512_256_init() local
441 ctx->H[0] = CURL_UINT64_C(0x22312194FC2BF72C); in MHDx_sha512_256_init()
442 ctx->H[1] = CURL_UINT64_C(0x9F555FA3C84C64C2); in MHDx_sha512_256_init()
443 ctx->H[2] = CURL_UINT64_C(0x2393B86B6F53B151); in MHDx_sha512_256_init()
444 ctx->H[3] = CURL_UINT64_C(0x963877195940EABD); in MHDx_sha512_256_init()
445 ctx->H[4] = CURL_UINT64_C(0x96283EE2A88EFFE3); in MHDx_sha512_256_init()
446 ctx->H[5] = CURL_UINT64_C(0xBE5E1E2553863992); in MHDx_sha512_256_init()
447 ctx->H[6] = CURL_UINT64_C(0x2B0199FC2C85B8AA); in MHDx_sha512_256_init()
448 ctx->H[7] = CURL_UINT64_C(0x0EB72DDC81C52CA2); in MHDx_sha512_256_init()
451 ctx->count = CURL_UINT64_C(0); in MHDx_sha512_256_init()
452 ctx->count_bits_hi = CURL_UINT64_C(0); in MHDx_sha512_256_init()
636 struct mhdx_sha512_256ctx *const ctx = (struct mhdx_sha512_256ctx *)context; in MHDx_sha512_256_update() local
638 void *const ctx_buf = ctx->buffer; in MHDx_sha512_256_update()
647 bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); in MHDx_sha512_256_update()
648 ctx->count += length; in MHDx_sha512_256_update()
649 if(length > ctx->count) in MHDx_sha512_256_update()
650 ctx->count_bits_hi += 1U << 3; /* Value wrap */ in MHDx_sha512_256_update()
651 ctx->count_bits_hi += ctx->count >> 61; in MHDx_sha512_256_update()
652 ctx->count &= CURL_UINT64_C(0x1FFFFFFFFFFFFFFF); in MHDx_sha512_256_update()
664 MHDx_sha512_256_transform(ctx->H, ctx->buffer); in MHDx_sha512_256_update()
672 MHDx_sha512_256_transform(ctx->H, data); in MHDx_sha512_256_update()
711 struct mhdx_sha512_256ctx *const ctx = (struct mhdx_sha512_256ctx *)context; in MHDx_sha512_256_finish() local
715 void *const ctx_buf = ctx->buffer; in MHDx_sha512_256_finish()
720 num_bits = ctx->count << 3; in MHDx_sha512_256_finish()
724 bytes_have = (unsigned int) (ctx->count & (CURL_SHA512_256_BLOCK_SIZE - 1)); in MHDx_sha512_256_finish()
745 MHDx_sha512_256_transform(ctx->H, ctx->buffer); in MHDx_sha512_256_finish()
760 ctx->count_bits_hi); in MHDx_sha512_256_finish()
767 MHDx_sha512_256_transform(ctx->H, ctx->buffer); in MHDx_sha512_256_finish()
772 MHDX_PUT_64BIT_BE((digest + 0 * SHA512_256_BYTES_IN_WORD), ctx->H[0]); in MHDx_sha512_256_finish()
773 MHDX_PUT_64BIT_BE((digest + 1 * SHA512_256_BYTES_IN_WORD), ctx->H[1]); in MHDx_sha512_256_finish()
774 MHDX_PUT_64BIT_BE((digest + 2 * SHA512_256_BYTES_IN_WORD), ctx->H[2]); in MHDx_sha512_256_finish()
775 MHDX_PUT_64BIT_BE((digest + 3 * SHA512_256_BYTES_IN_WORD), ctx->H[3]); in MHDx_sha512_256_finish()
778 memset(ctx, 0, sizeof(struct mhdx_sha512_256ctx)); in MHDx_sha512_256_finish()
802 Curl_sha512_256_ctx ctx; in Curl_sha512_256it() local
805 res = Curl_sha512_256_init(&ctx); in Curl_sha512_256it()
809 res = Curl_sha512_256_update(&ctx, (const void *) input, input_size); in Curl_sha512_256it()
812 (void) Curl_sha512_256_finish(output, &ctx); in Curl_sha512_256it()
816 return Curl_sha512_256_finish(output, &ctx); in Curl_sha512_256it()