Home
last modified time | relevance | path

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

123

/third_party/node/deps/openssl/openssl/crypto/md5/
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()
27 int ossl_md5_sha1_update(MD5_SHA1_CTX *mctx, const void *data, size_t count) in ossl_md5_sha1_update() argument
29 if (!MD5_Update(&mctx->md5, data, count)) in ossl_md5_sha1_update()
31 return SHA1_Update(&mctx->sha1, data, count); in ossl_md5_sha1_update()
34 int ossl_md5_sha1_final(unsigned char *md, MD5_SHA1_CTX *mctx) in ossl_md5_sha1_final() argument
36 if (!MD5_Final(md, &mctx->md5)) in ossl_md5_sha1_final()
38 return SHA1_Final(md + MD5_DIGEST_LENGTH, &mctx->sha1); in ossl_md5_sha1_final()
41 int ossl_md5_sha1_ctrl(MD5_SHA1_CTX *mctx, int cmd, int mslen, void *ms) in ossl_md5_sha1_ctrl() argument
[all …]
/third_party/openssl/crypto/md5/
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()
27 int ossl_md5_sha1_update(MD5_SHA1_CTX *mctx, const void *data, size_t count) in ossl_md5_sha1_update() argument
29 if (!MD5_Update(&mctx->md5, data, count)) in ossl_md5_sha1_update()
31 return SHA1_Update(&mctx->sha1, data, count); in ossl_md5_sha1_update()
34 int ossl_md5_sha1_final(unsigned char *md, MD5_SHA1_CTX *mctx) in ossl_md5_sha1_final() argument
36 if (!MD5_Final(md, &mctx->md5)) in ossl_md5_sha1_final()
38 return SHA1_Final(md + MD5_DIGEST_LENGTH, &mctx->sha1); in ossl_md5_sha1_final()
41 int ossl_md5_sha1_ctrl(MD5_SHA1_CTX *mctx, int cmd, int mslen, void *ms) in ossl_md5_sha1_ctrl() argument
[all …]
/third_party/openssl/test/
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()
107 || !TEST_true(EVP_DigestInit_ex(mctx, EVP_get_digestbynid(md_nid), NULL)) in x9_62_tests()
108 || !TEST_true(EVP_DigestUpdate(mctx, message, msg_len)) in x9_62_tests()
109 || !TEST_true(EVP_DigestFinal_ex(mctx, digest, &dgst_len)) in x9_62_tests()
154 EVP_MD_CTX_free(mctx); in x9_62_tests()
176 static int set_sm2_id(EVP_MD_CTX *mctx, EVP_PKEY *pkey) in set_sm2_id() argument
182 if (!TEST_ptr(pctx = EVP_MD_CTX_get_pkey_ctx(mctx)) in set_sm2_id()
194 EVP_MD_CTX *mctx = NULL; in test_builtin() local
224 if (!TEST_ptr(mctx = EVP_MD_CTX_new()) in test_builtin()
[all …]
/third_party/openssl/demos/signature/
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()
64 if (EVP_DigestSignInit_ex(mctx, NULL, "SHA256", libctx, propq, in sign()
74 if (EVP_DigestSignUpdate(mctx, test_message, sizeof(test_message)) == 0) { 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()
[all …]
/third_party/node/deps/openssl/openssl/providers/implementations/ciphers/
Dcipher_aes_cbc_hmac_sha256_hw.c140 SHA256_MB_CTX *mctx; in tls1_multi_block_encrypt() local
153 mctx = (SHA256_MB_CTX *) (storage + 32 - ((size_t)storage % 32)); /* align */ in tls1_multi_block_encrypt()
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()
[all …]
Dcipher_aes_cbc_hmac_sha1_hw.c136 SHA1_MB_CTX *mctx; in tls1_multi_block_encrypt() local
149 mctx = (SHA1_MB_CTX *) (storage + 32 - ((size_t)storage % 32)); /* align */ in tls1_multi_block_encrypt()
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()
218 sha1_multi_block(mctx, edges, n4x); in tls1_multi_block_encrypt()
236 sha1_multi_block(mctx, edges, n4x); in tls1_multi_block_encrypt()
254 sha1_multi_block(mctx, hash_d, n4x); in tls1_multi_block_encrypt()
[all …]
/third_party/openssl/providers/implementations/ciphers/
Dcipher_aes_cbc_hmac_sha256_hw.c140 SHA256_MB_CTX *mctx; in tls1_multi_block_encrypt() local
153 mctx = (SHA256_MB_CTX *) (storage + 32 - ((size_t)storage % 32)); /* align */ in tls1_multi_block_encrypt()
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()
[all …]
Dcipher_aes_cbc_hmac_sha1_hw.c136 SHA1_MB_CTX *mctx; in tls1_multi_block_encrypt() local
149 mctx = (SHA1_MB_CTX *) (storage + 32 - ((size_t)storage % 32)); /* align */ in tls1_multi_block_encrypt()
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()
218 sha1_multi_block(mctx, edges, n4x); in tls1_multi_block_encrypt()
236 sha1_multi_block(mctx, edges, n4x); in tls1_multi_block_encrypt()
254 sha1_multi_block(mctx, hash_d, n4x); in tls1_multi_block_encrypt()
[all …]
/third_party/openssl/demos/mac/
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()
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()
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()
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()
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()
/third_party/openssl/crypto/cms/
Dcms_sd.c334 si->mctx = EVP_MD_CTX_new(); in CMS_add1_signer()
337 if (si->mctx == NULL) { in CMS_add1_signer()
472 } else if (EVP_DigestSignInit_ex(si->mctx, &si->pctx, in CMS_add1_signer()
550 return si->mctx; in CMS_SignerInfo_get0_md_ctx()
673 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in cms_SignerInfo_content_sign() local
678 if (mctx == NULL) { in cms_SignerInfo_content_sign()
688 if (!ossl_cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) in cms_SignerInfo_content_sign()
702 if (!EVP_DigestFinal_ex(mctx, md, &mdlen)) in cms_SignerInfo_content_sign()
720 if (!EVP_DigestFinal_ex(mctx, md, &mdlen)) in cms_SignerInfo_content_sign()
742 if (!EVP_SignFinal_ex(mctx, sig, &siglen, si->pkey, in cms_SignerInfo_content_sign()
[all …]
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()
/third_party/node/deps/openssl/openssl/crypto/cms/
Dcms_sd.c334 si->mctx = EVP_MD_CTX_new(); in CMS_add1_signer()
337 if (si->mctx == NULL) { in CMS_add1_signer()
472 } else if (EVP_DigestSignInit_ex(si->mctx, &si->pctx, in CMS_add1_signer()
550 return si->mctx; in CMS_SignerInfo_get0_md_ctx()
673 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in cms_SignerInfo_content_sign() local
678 if (mctx == NULL) { in cms_SignerInfo_content_sign()
688 if (!ossl_cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) in cms_SignerInfo_content_sign()
702 if (!EVP_DigestFinal_ex(mctx, md, &mdlen)) in cms_SignerInfo_content_sign()
720 if (!EVP_DigestFinal_ex(mctx, md, &mdlen)) in cms_SignerInfo_content_sign()
742 if (!EVP_SignFinal_ex(mctx, sig, &siglen, si->pkey, in cms_SignerInfo_content_sign()
[all …]
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()
/third_party/openssl/apps/
Dpkeyutl.c27 EVP_MD_CTX *mctx, const char *digestname,
37 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
127 EVP_MD_CTX *mctx = NULL; in pkeyutl_main() local
300 if ((mctx = EVP_MD_CTX_new()) == NULL) { in pkeyutl_main()
307 mctx, digestname, libctx, app_get0_propq()); in pkeyutl_main()
453 rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, sig, siglen, in pkeyutl_main()
469 rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0, in pkeyutl_main()
508 EVP_MD_CTX_free(mctx); in pkeyutl_main()
527 EVP_PKEY **ppkey, EVP_MD_CTX *mctx, const char *digestname, in init_ctx() argument
607 EVP_MD_CTX_set_pkey_ctx(mctx, ctx); in init_ctx()
[all …]
/third_party/node/deps/openssl/openssl/apps/
Dpkeyutl.c27 EVP_MD_CTX *mctx, const char *digestname,
37 static int do_raw_keyop(int pkey_op, EVP_MD_CTX *mctx,
127 EVP_MD_CTX *mctx = NULL; in pkeyutl_main() local
300 if ((mctx = EVP_MD_CTX_new()) == NULL) { in pkeyutl_main()
307 mctx, digestname, libctx, app_get0_propq()); in pkeyutl_main()
453 rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, sig, siglen, in pkeyutl_main()
469 rv = do_raw_keyop(pkey_op, mctx, pkey, in, filesize, NULL, 0, in pkeyutl_main()
508 EVP_MD_CTX_free(mctx); in pkeyutl_main()
527 EVP_PKEY **ppkey, EVP_MD_CTX *mctx, const char *digestname, in init_ctx() argument
607 EVP_MD_CTX_set_pkey_ctx(mctx, ctx); in init_ctx()
[all …]
/third_party/openssl/providers/implementations/include/prov/
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);
/third_party/node/deps/openssl/openssl/providers/implementations/include/prov/
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);
/third_party/openssl/doc/man7/
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);
29 int OSSL_FUNC_mac_final(void *mctx, unsigned char *out, size_t *outl, size_t outsize);
33 const OSSL_PARAM *OSSL_FUNC_mac_gettable_ctx_params(void *mctx, void *provctx);
34 const OSSL_PARAM *OSSL_FUNC_mac_settable_ctx_params(void *mctx, void *provctx);
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
[all …]
DEVP_PKEY-SM2.pod50 EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
69 mctx = EVP_MD_CTX_new();
72 EVP_MD_CTX_set_pkey_ctx(mctx, pctx);
73 EVP_DigestVerifyInit(mctx, NULL, EVP_sm3(), NULL, pkey);
74 EVP_DigestVerifyUpdate(mctx, msg, msg_len);
75 EVP_DigestVerifyFinal(mctx, sig, sig_len)
/third_party/openssl/crypto/ffc/
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()
169 || !EVP_DigestUpdate(mctx, seed, seedlen) in generate_canonical_g()
170 || !EVP_DigestUpdate(mctx, ggen, sizeof(ggen)) 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()
528 EVP_MD_CTX *mctx = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
[all …]
/third_party/node/deps/openssl/openssl/crypto/ffc/
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()
169 || !EVP_DigestUpdate(mctx, seed, seedlen) in generate_canonical_g()
170 || !EVP_DigestUpdate(mctx, ggen, sizeof(ggen)) 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()
528 EVP_MD_CTX *mctx = NULL; in ossl_ffc_params_FIPS186_4_gen_verify() local
[all …]

123