Lines Matching refs:ctx
107 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_init() local
108 ctx->openssl_ctx = EVP_MD_CTX_create(); in my_sha256_init()
109 if(!ctx->openssl_ctx) in my_sha256_init()
112 if(!EVP_DigestInit_ex(ctx->openssl_ctx, EVP_sha256(), NULL)) { in my_sha256_init()
113 EVP_MD_CTX_destroy(ctx->openssl_ctx); in my_sha256_init()
123 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_update() local
124 EVP_DigestUpdate(ctx->openssl_ctx, data, length); in my_sha256_update()
129 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_final() local
130 EVP_DigestFinal_ex(ctx->openssl_ctx, digest, NULL); in my_sha256_final()
131 EVP_MD_CTX_destroy(ctx->openssl_ctx); in my_sha256_final()
138 static CURLcode my_sha256_init(void *ctx) in my_sha256_init() argument
140 sha256_init(ctx); in my_sha256_init()
144 static void my_sha256_update(void *ctx, in my_sha256_update() argument
148 sha256_update(ctx, length, data); in my_sha256_update()
151 static void my_sha256_final(unsigned char *digest, void *ctx) in my_sha256_final() argument
153 sha256_digest(ctx, SHA256_DIGEST_SIZE, digest); in my_sha256_final()
160 static CURLcode my_sha256_init(void *ctx) in my_sha256_init() argument
163 (void) mbedtls_sha256_starts(ctx, 0); in my_sha256_init()
165 (void) mbedtls_sha256_starts_ret(ctx, 0); in my_sha256_init()
170 static void my_sha256_update(void *ctx, in my_sha256_update() argument
175 (void) mbedtls_sha256_update(ctx, data, length); in my_sha256_update()
177 (void) mbedtls_sha256_update_ret(ctx, data, length); in my_sha256_update()
181 static void my_sha256_final(unsigned char *digest, void *ctx) in my_sha256_final() argument
184 (void) mbedtls_sha256_finish(ctx, digest); in my_sha256_final()
186 (void) mbedtls_sha256_finish_ret(ctx, digest); in my_sha256_final()
193 static CURLcode my_sha256_init(void *ctx) in my_sha256_init() argument
195 (void) CC_SHA256_Init(ctx); in my_sha256_init()
199 static void my_sha256_update(void *ctx, in my_sha256_update() argument
203 (void) CC_SHA256_Update(ctx, data, length); in my_sha256_update()
206 static void my_sha256_final(unsigned char *digest, void *ctx) in my_sha256_final() argument
208 (void) CC_SHA256_Final(digest, ctx); in my_sha256_final()
225 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_init() local
226 if(!CryptAcquireContext(&ctx->hCryptProv, NULL, NULL, PROV_RSA_AES, in my_sha256_init()
230 if(!CryptCreateHash(ctx->hCryptProv, CALG_SHA_256, 0, 0, &ctx->hHash)) { in my_sha256_init()
231 CryptReleaseContext(ctx->hCryptProv, 0); in my_sha256_init()
232 ctx->hCryptProv = 0; in my_sha256_init()
243 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_update() local
244 CryptHashData(ctx->hHash, (unsigned char *) data, length, 0); in my_sha256_update()
249 my_sha256_ctx *ctx = (my_sha256_ctx *)in; in my_sha256_final() local
252 CryptGetHashParam(ctx->hHash, HP_HASHVAL, NULL, &length, 0); in my_sha256_final()
254 CryptGetHashParam(ctx->hHash, HP_HASHVAL, digest, &length, 0); in my_sha256_final()
256 if(ctx->hHash) in my_sha256_final()
257 CryptDestroyHash(ctx->hHash); in my_sha256_final()
259 if(ctx->hCryptProv) in my_sha256_final()
260 CryptReleaseContext(ctx->hCryptProv, 0); in my_sha256_final()
417 static void my_sha256_update(void *ctx, in my_sha256_update() argument
423 struct sha256_state *md = (struct sha256_state *)ctx; in my_sha256_update()
457 static void my_sha256_final(unsigned char *out, void *ctx) in my_sha256_final() argument
459 struct sha256_state *md = ctx; in my_sha256_final()
516 my_sha256_ctx ctx; in Curl_sha256it() local
518 result = my_sha256_init(&ctx); in Curl_sha256it()
520 my_sha256_update(&ctx, input, curlx_uztoui(length)); in Curl_sha256it()
521 my_sha256_final(output, &ctx); in Curl_sha256it()