Home
last modified time | relevance | path

Searched refs:mctx (Results 1 – 25 of 38) sorted by relevance

12

/openssl/crypto/md5/
H A Dmd5_sha1.c20 int ossl_md5_sha1_init(MD5_SHA1_CTX *mctx) in ossl_md5_sha1_init() argument
22 if (!MD5_Init(&mctx->md5)) in ossl_md5_sha1_init()
24 return SHA1_Init(&mctx->sha1); in ossl_md5_sha1_init()
29 if (!MD5_Update(&mctx->md5, data, count)) in ossl_md5_sha1_update()
36 if (!MD5_Final(md, &mctx->md5)) in ossl_md5_sha1_final()
50 if (mctx == NULL) in ossl_md5_sha1_ctrl()
70 if (!MD5_Final(md5tmp, &mctx->md5)) in ossl_md5_sha1_ctrl()
73 if (!SHA1_Update(&mctx->sha1, padtmp, 40)) in ossl_md5_sha1_ctrl()
76 if (!SHA1_Final(sha1tmp, &mctx->sha1)) in ossl_md5_sha1_ctrl()
81 if (!ossl_md5_sha1_init(mctx)) in ossl_md5_sha1_ctrl()
[all …]
/openssl/test/
H A Decdsatest.c82 EVP_MD_CTX *mctx = NULL; in x9_62_tests() local
104 if (!TEST_ptr(mctx = EVP_MD_CTX_new()) in x9_62_tests()
154 EVP_MD_CTX_free(mctx); in x9_62_tests()
194 EVP_MD_CTX *mctx = NULL; in test_builtin() local
224 if (!TEST_ptr(mctx = EVP_MD_CTX_new()) in test_builtin()
253 || !TEST_true(EVP_MD_CTX_reset(mctx)) in test_builtin()
258 || !TEST_true(EVP_MD_CTX_reset(mctx)) in test_builtin()
263 || !TEST_true(EVP_MD_CTX_reset(mctx)) in test_builtin()
268 || !TEST_true(EVP_MD_CTX_reset(mctx))) in test_builtin()
276 || !TEST_true(EVP_MD_CTX_reset(mctx))) in test_builtin()
[all …]
/openssl/demos/signature/
H A Drsa_pss_hash.c37 EVP_MD_CTX *mctx = NULL; in sign() local
53 mctx = EVP_MD_CTX_new(); in sign()
54 if (mctx == NULL) { in sign()
80 if (EVP_DigestSignFinal(mctx, NULL, sig_len) == 0) { in sign()
93 if (EVP_DigestSignFinal(mctx, *sig, sig_len) == 0) { in sign()
100 EVP_MD_CTX_free(mctx); in sign()
118 EVP_MD_CTX *mctx = NULL; in verify() local
131 mctx = EVP_MD_CTX_new(); in verify()
132 if (mctx == NULL) { in verify()
158 if (EVP_DigestVerifyFinal(mctx, sig, sig_len) == 0) { in verify()
[all …]
/openssl/providers/implementations/ciphers/
H A Dcipher_aes_cbc_hmac_sha256_hw.c140 SHA256_MB_CTX *mctx; in tls1_multi_block_encrypt() local
192 mctx->A[i] = sctx->md.h[0]; in tls1_multi_block_encrypt()
193 mctx->B[i] = sctx->md.h[1]; in tls1_multi_block_encrypt()
194 mctx->C[i] = sctx->md.h[2]; in tls1_multi_block_encrypt()
195 mctx->D[i] = sctx->md.h[3]; in tls1_multi_block_encrypt()
196 mctx->E[i] = sctx->md.h[4]; in tls1_multi_block_encrypt()
197 mctx->F[i] = sctx->md.h[5]; in tls1_multi_block_encrypt()
198 mctx->G[i] = sctx->md.h[6]; in tls1_multi_block_encrypt()
199 mctx->H[i] = sctx->md.h[7]; in tls1_multi_block_encrypt()
354 PUTU32(out + 0, mctx->A[i]); in tls1_multi_block_encrypt()
[all …]
H A Dcipher_aes_cbc_hmac_sha1_hw.c136 SHA1_MB_CTX *mctx; in tls1_multi_block_encrypt() local
187 mctx->A[i] = sctx->md.h0; in tls1_multi_block_encrypt()
188 mctx->B[i] = sctx->md.h1; in tls1_multi_block_encrypt()
189 mctx->C[i] = sctx->md.h2; in tls1_multi_block_encrypt()
190 mctx->D[i] = sctx->md.h3; in tls1_multi_block_encrypt()
191 mctx->E[i] = sctx->md.h4; in tls1_multi_block_encrypt()
292 mctx->A[i] = sctx->tail.h0; in tls1_multi_block_encrypt()
294 mctx->B[i] = sctx->tail.h1; in tls1_multi_block_encrypt()
296 mctx->C[i] = sctx->tail.h2; in tls1_multi_block_encrypt()
298 mctx->D[i] = sctx->tail.h3; in tls1_multi_block_encrypt()
[all …]
/openssl/demos/mac/
H A Dcmac-aes256.c71 EVP_MAC_CTX *mctx = NULL; in main() local
91 mctx = EVP_MAC_CTX_new(mac); in main()
92 if (mctx == NULL) { in main()
103 if (!EVP_MAC_init(mctx, key, sizeof(key), params)) { in main()
109 if (!EVP_MAC_update(mctx, data, sizeof(data))) { in main()
115 if (!EVP_MAC_final(mctx, NULL, &out_len, 0)) { in main()
125 if (!EVP_MAC_final(mctx, out, &out_len, out_len)) { in main()
150 EVP_MAC_CTX_free(mctx); in main()
H A Dhmac-sha512.c81 EVP_MAC_CTX *mctx = NULL; in main() local
102 mctx = EVP_MAC_CTX_new(mac); in main()
103 if (mctx == NULL) { in main()
114 if (!EVP_MAC_init(mctx, key, sizeof(key), params)) { in main()
120 if (!EVP_MAC_update(mctx, data, sizeof(data))) { in main()
126 if (!EVP_MAC_final(mctx, NULL, &out_len, 0)) { in main()
136 if (!EVP_MAC_final(mctx, out, &out_len, out_len)) { in main()
162 EVP_MAC_CTX_free(mctx); in main()
H A Dgmac.c62 EVP_MAC_CTX *mctx = NULL; in main() local
82 mctx = EVP_MAC_CTX_new(mac); in main()
83 if (mctx == NULL) { in main()
106 if (!EVP_MAC_init(mctx, key, sizeof(key), params)) { in main()
112 if (!EVP_MAC_update(mctx, data, sizeof(data))) { in main()
118 if (!EVP_MAC_final(mctx, out, &out_len, sizeof(out))) { in main()
139 EVP_MAC_CTX_free(mctx); in main()
H A Dsiphash.c49 EVP_MAC_CTX *mctx = NULL; in main() local
70 mctx = EVP_MAC_CTX_new(mac); in main()
71 if (mctx == NULL) { in main()
90 if (!EVP_MAC_init(mctx, key, sizeof(key), params)) { in main()
96 if (!EVP_MAC_update(mctx, data, sizeof(data))) { in main()
102 if (!EVP_MAC_final(mctx, out, &out_len, sizeof(out))) { in main()
123 EVP_MAC_CTX_free(mctx); in main()
H A Dpoly1305.c90 EVP_MAC_CTX *mctx = NULL; in main() local
111 mctx = EVP_MAC_CTX_new(mac); in main()
112 if (mctx == NULL) { in main()
168 if (!EVP_MAC_init(mctx, composite_key, sizeof(composite_key), NULL)) { in main()
174 if (!EVP_MAC_update(mctx, test_m, sizeof(test_m))) { in main()
180 if (!EVP_MAC_final(mctx, out, &out_len, sizeof(out))) { in main()
203 EVP_MAC_CTX_free(mctx); in main()
/openssl/crypto/cms/
H A Dcms_sd.c368 if (si->mctx == NULL) { in CMS_add1_signer()
593 return si->mctx; in CMS_SignerInfo_get0_md_ctx()
723 if (mctx == NULL) { in cms_SignerInfo_content_sign()
803 EVP_MD_CTX_free(mctx); in cms_SignerInfo_content_sign()
830 EVP_MD_CTX *mctx = si->mctx; in CMS_SignerInfo_sign() local
878 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_sign()
886 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_sign()
926 if (si->mctx == NULL && (si->mctx = EVP_MD_CTX_new()) == NULL) { in CMS_SignerInfo_verify()
930 mctx = si->mctx; in CMS_SignerInfo_verify()
1006 if (mctx == NULL) { in CMS_SignerInfo_verify_content()
[all …]
H A Dcms_dd.c62 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in ossl_cms_DigestedData_do_final() local
68 if (mctx == NULL) { in ossl_cms_DigestedData_do_final()
75 if (!ossl_cms_DigestAlgorithm_find_ctx(mctx, chain, dd->digestAlgorithm)) in ossl_cms_DigestedData_do_final()
78 if (EVP_DigestFinal_ex(mctx, md, &mdlen) <= 0) in ossl_cms_DigestedData_do_final()
98 EVP_MD_CTX_free(mctx); in ossl_cms_DigestedData_do_final()
/openssl/providers/implementations/include/prov/
H A Dmd5_sha1.h29 int ossl_md5_sha1_init(MD5_SHA1_CTX *mctx);
30 int ossl_md5_sha1_update(MD5_SHA1_CTX *mctx, const void *data, size_t count);
31 int ossl_md5_sha1_final(unsigned char *md, MD5_SHA1_CTX *mctx);
32 int ossl_md5_sha1_ctrl(MD5_SHA1_CTX *mctx, int cmd, int mslen, void *ms);
/openssl/apps/
H A Dpkeyutl.c30 EVP_MD_CTX *mctx, const char *digestname,
41 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
151 EVP_MD_CTX *mctx = NULL; in pkeyutl_main() local
345 if ((mctx = EVP_MD_CTX_new()) == NULL) { in pkeyutl_main()
570 EVP_MD_CTX_free(mctx); in pkeyutl_main()
677 EVP_MD_CTX_set_pkey_ctx(mctx, ctx); in init_ctx()
802 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx, in do_raw_keyop() argument
861 rv = EVP_DigestVerifyFinal(mctx, sig, (size_t)siglen); in do_raw_keyop()
872 rv = EVP_DigestSignUpdate(mctx, tbuf, (size_t)buf_len); in do_raw_keyop()
878 rv = EVP_DigestSignFinal(mctx, NULL, poutlen); in do_raw_keyop()
[all …]
H A Ddgst.c341 EVP_MD_CTX *mctx = NULL; in dgst_main() local
345 if (BIO_get_md_ctx(bmd, &mctx) <= 0) { in dgst_main()
351 res = EVP_DigestVerifyInit_ex(mctx, &pctx, digestname, in dgst_main()
355 res = EVP_DigestVerifyInit(mctx, &pctx, md, impl, sigkey); in dgst_main()
358 res = EVP_DigestSignInit_ex(mctx, &pctx, digestname, in dgst_main()
362 res = EVP_DigestSignInit(mctx, &pctx, md, impl, sigkey); in dgst_main()
381 EVP_MD_CTX *mctx = NULL; in dgst_main() local
382 if (BIO_get_md_ctx(bmd, &mctx) <= 0) { in dgst_main()
388 if (!EVP_DigestInit_ex(mctx, md, impl)) { in dgst_main()
/openssl/providers/implementations/kdfs/
H A Dpvkkdf.c138 EVP_MD_CTX *mctx; in kdf_pvk_derive() local
169 mctx = EVP_MD_CTX_new(); in kdf_pvk_derive()
170 res = mctx != NULL in kdf_pvk_derive()
171 && EVP_DigestInit_ex(mctx, md, NULL) in kdf_pvk_derive()
172 && EVP_DigestUpdate(mctx, ctx->salt, ctx->salt_len) in kdf_pvk_derive()
173 && EVP_DigestUpdate(mctx, ctx->pass, ctx->pass_len) in kdf_pvk_derive()
174 && EVP_DigestFinal_ex(mctx, key, NULL); in kdf_pvk_derive()
175 EVP_MD_CTX_free(mctx); in kdf_pvk_derive()
/openssl/doc/man7/
H A Dprovider-mac.pod22 void OSSL_FUNC_mac_freectx(void *mctx);
26 int OSSL_FUNC_mac_init(void *mctx, unsigned char *key, size_t keylen,
28 int OSSL_FUNC_mac_update(void *mctx, const unsigned char *in, size_t inl);
38 int OSSL_FUNC_mac_get_ctx_params(void *mctx, OSSL_PARAM params[]);
39 int OSSL_FUNC_mac_set_ctx_params(void *mctx, const OSSL_PARAM params[]);
101 the I<mctx> parameter.
102 If it receives NULL as I<mctx> value, it should not do anything other than
107 I<mctx> parameter and return the duplicate copy.
123 The I<mctx> parameter contains a pointer to the provider side context.
138 provider side mac context I<mctx> to I<params>.
[all …]
H A DEVP_PKEY-SM2.pod53 EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
72 mctx = EVP_MD_CTX_new();
75 EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
76 EVP_DigestVerifyInit(mctx, NULL, EVP_sm3(), NULL, pkey);
77 EVP_DigestVerifyUpdate(mctx, msg, msg_len);
78 EVP_DigestVerifyFinal(mctx, sig, sig_len)
/openssl/crypto/ffc/
H A Dffc_params_generate.c140 EVP_MD_CTX *mctx = NULL; in generate_canonical_g() local
147 mctx = EVP_MD_CTX_new(); in generate_canonical_g()
148 if (mctx == NULL) in generate_canonical_g()
168 if (!EVP_DigestInit_ex(mctx, evpmd, NULL) in generate_canonical_g()
171 || !EVP_DigestUpdate(mctx, md, 3) in generate_canonical_g()
172 || !EVP_DigestFinal_ex(mctx, md, NULL) in generate_canonical_g()
186 EVP_MD_CTX_free(mctx); in generate_canonical_g()
531 EVP_MD_CTX *mctx = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
571 mctx = EVP_MD_CTX_new(); in ossl_ffc_params_FIPS186_4_gen_verify()
572 if (mctx == NULL) in ossl_ffc_params_FIPS186_4_gen_verify()
[all …]
/openssl/doc/man3/
H A DEVP_PKEY_meth_new.pod86 EVP_MD_CTX *mctx),
90 EVP_MD_CTX *mctx));
97 EVP_MD_CTX *mctx));
186 EVP_MD_CTX *mctx),
190 EVP_MD_CTX *mctx));
197 EVP_MD_CTX *mctx));
318 int (*signctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
320 EVP_MD_CTX *mctx);
326 int (*verifyctx_init) (EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx);
328 EVP_MD_CTX *mctx);
[all …]
/openssl/crypto/engine/
H A Deng_openssl.c529 static int ossl_hmac_signctx_init(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx) in ossl_hmac_signctx_init() argument
531 EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_NO_INIT); in ossl_hmac_signctx_init()
532 EVP_MD_CTX_set_update_fn(mctx, ossl_int_update); in ossl_hmac_signctx_init()
537 size_t *siglen, EVP_MD_CTX *mctx) in ossl_hmac_signctx() argument
541 int l = EVP_MD_CTX_get_size(mctx); in ossl_hmac_signctx()
/openssl/ssl/statem/
H A Dstatem_lib.c314 EVP_MD_CTX *mctx = NULL; in tls_construct_cert_verify() local
334 mctx = EVP_MD_CTX_new(); in tls_construct_cert_verify()
335 if (mctx == NULL) { in tls_construct_cert_verify()
351 if (EVP_DigestSignInit_ex(mctx, &pctx, in tls_construct_cert_verify()
427 EVP_MD_CTX_free(mctx); in tls_construct_cert_verify()
431 EVP_MD_CTX_free(mctx); in tls_construct_cert_verify()
449 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in tls_process_cert_verify() local
453 if (mctx == NULL) { in tls_process_cert_verify()
533 if (EVP_DigestVerifyInit_ex(mctx, &pctx, in tls_process_cert_verify()
570 if (EVP_DigestVerifyFinal(mctx, data, len) <= 0) { in tls_process_cert_verify()
[all …]
H A Dextensions.c1544 EVP_MD_CTX *mctx = NULL; in tls_psk_do_binder() local
1603 mctx = EVP_MD_CTX_new(); in tls_psk_do_binder()
1604 if (mctx == NULL in tls_psk_do_binder()
1605 || EVP_DigestInit_ex(mctx, md, NULL) <= 0 in tls_psk_do_binder()
1606 || EVP_DigestFinal_ex(mctx, hash, NULL) <= 0) { in tls_psk_do_binder()
1624 if (EVP_DigestInit_ex(mctx, md, NULL) <= 0) { in tls_psk_do_binder()
1665 if (EVP_DigestUpdate(mctx, hdata, hdatalen) <= 0) { in tls_psk_do_binder()
1671 if (EVP_DigestUpdate(mctx, msgstart, binderoffset) <= 0 in tls_psk_do_binder()
1672 || EVP_DigestFinal_ex(mctx, hash, NULL) <= 0) { in tls_psk_do_binder()
1691 || EVP_DigestSignUpdate(mctx, hash, hashsize) <= 0 in tls_psk_do_binder()
[all …]
/openssl/crypto/pkcs7/
H A Dpk7_doit.c738 static int do_pkcs7_signed_attrib(PKCS7_SIGNER_INFO *si, EVP_MD_CTX *mctx) in do_pkcs7_signed_attrib() argument
752 if (!EVP_DigestFinal_ex(mctx, md_data, &md_len)) { in do_pkcs7_signed_attrib()
948 EVP_MD_CTX *mctx; in PKCS7_SIGNER_INFO_sign() local
960 mctx = EVP_MD_CTX_new(); in PKCS7_SIGNER_INFO_sign()
961 if (mctx == NULL) { in PKCS7_SIGNER_INFO_sign()
966 if (EVP_DigestSignInit_ex(mctx, &pctx, EVP_MD_get0_name(md), in PKCS7_SIGNER_INFO_sign()
976 if (EVP_DigestSignUpdate(mctx, abuf, alen) <= 0) in PKCS7_SIGNER_INFO_sign()
980 if (EVP_DigestSignFinal(mctx, NULL, &siglen) <= 0) in PKCS7_SIGNER_INFO_sign()
985 if (EVP_DigestSignFinal(mctx, abuf, &siglen) <= 0) in PKCS7_SIGNER_INFO_sign()
988 EVP_MD_CTX_free(mctx); in PKCS7_SIGNER_INFO_sign()
[all …]
/openssl/include/openssl/
H A Dcore_dispatch.h412 OSSL_CORE_MAKE_FUNC(void, mac_freectx, (void *mctx))
413 OSSL_CORE_MAKE_FUNC(int, mac_init, (void *mctx, const unsigned char *key,
416 (void *mctx, const unsigned char *in, size_t inl))
418 (void *mctx,
422 (void *mctx, void *provctx))
424 (void *mctx, void *provctx))
427 (void *mctx, OSSL_PARAM params[]))
429 (void *mctx, const OSSL_PARAM params[]))

Completed in 62 milliseconds

12