Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 25 of 1109) sorted by relevance

12345678910>>...45

/openssl/crypto/
H A Dcontext.c75 ctx = ossl_lib_ctx_get_concrete(ctx); in ossl_lib_ctx_is_child()
113 ctx->drbg = ossl_rand_ctx_new(ctx); in context_init()
122 ctx->decoder_store = ossl_method_store_new(ctx); in context_init()
130 ctx->encoder_store = ossl_method_store_new(ctx); in context_init()
150 ctx->namemap = ossl_stored_namemap_new(ctx); in context_init()
163 ctx->bio_core = ossl_bio_core_globals_new(ctx); in context_init()
192 ctx->threads = ossl_threads_ctx_new(ctx); in context_init()
222 memset(ctx, '\0', sizeof(*ctx)); in context_init()
442 if (ctx != NULL && !context_init(ctx)) { in OSSL_LIB_CTX_new()
563 ctx = ossl_lib_ctx_get_concrete(ctx); in ossl_lib_ctx_get_data()
[all …]
/openssl/crypto/evp/
H A Dbio_b64.c142 i = ctx->buf_len - ctx->buf_off; in b64_read()
151 if (ctx->buf_len == ctx->buf_off) { in b64_read()
158 ret_code = ctx->cont < 0 ? ctx->cont : 0; in b64_read()
279 i = EVP_DecodeUpdate(ctx->base64, ctx->buf, &ctx->buf_len, in b64_read()
305 if (ctx->buf_off == ctx->buf_len) { in b64_read()
343 n = ctx->buf_len - ctx->buf_off; in b64_write()
381 EVP_EncodeBlock(ctx->buf, ctx->tmp, ctx->tmp_len); in b64_write()
404 if (!EVP_EncodeUpdate(ctx->base64, ctx->buf, &ctx->buf_len, in b64_write()
461 ret = ctx->buf_len - ctx->buf_off; in b64_ctrl()
470 ret = ctx->buf_len - ctx->buf_off; in b64_ctrl()
[all …]
H A Dbio_ok.c187 i = ctx->buf_len - ctx->buf_off; in ok_read()
204 ctx->buf_len = ctx->buf_len_save - ctx->buf_off_save; in ok_read()
205 memmove(ctx->buf, &(ctx->buf[ctx->buf_off_save]), in ok_read()
275 n = ctx->buf_len - ctx->buf_off; in ok_write()
290 if (ctx->buf_len == ctx->buf_off) { in ok_write()
351 ret = ctx->blockout ? ctx->buf_len - ctx->buf_off : 0; in ok_ctrl()
370 ctx->buf_off = ctx->buf_len = 0; in ok_ctrl()
511 if (ctx->buf_len != ctx->buf_off) { in sig_in()
512 memmove(ctx->buf, &(ctx->buf[ctx->buf_off]), in sig_in()
515 ctx->buf_len -= ctx->buf_off; in sig_in()
[all …]
H A Dbio_enc.c78 ctx->read_end = ctx->read_start = &(ctx->buf[BUF_OFFSET]); in enc_new()
120 i = ctx->buf_len - ctx->buf_off; in enc_read()
123 memcpy(out, &(ctx->buf[ctx->buf_off]), i); in enc_read()
128 if (ctx->buf_len == ctx->buf_off) { in enc_read()
152 ctx->read_end = ctx->read_start = &(ctx->buf[BUF_OFFSET]); in enc_read()
157 i = ctx->read_end - ctx->read_start; in enc_read()
250 n = ctx->buf_len - ctx->buf_off; in enc_write()
327 ret = ctx->buf_len - ctx->buf_off; in enc_ctrl()
332 ret = ctx->buf_len - ctx->buf_off; in enc_ctrl()
339 while (ctx->buf_len != ctx->buf_off) { in enc_ctrl()
[all …]
H A Dctrl_params_translate.c762 ctx->orig_p2 = ctx->p2; in fix_cipher_md()
763 ctx->p2 = ctx->name_buf; in fix_cipher_md()
774 ctx->p1 = strlen(ctx->p2); in fix_cipher_md()
777 ctx->p1 = strlen(ctx->p2); in fix_cipher_md()
895 ctx->p1 = strlen(ctx->p2); in fix_kdf_type()
1277 ctx->orig_p2 = ctx->p2; in fix_rsa_padding_mode()
1278 ctx->p2 = ctx->name_buf; in fix_rsa_padding_mode()
1398 ctx->orig_p2 = ctx->p2; in fix_rsa_pss_saltlen()
1399 ctx->p2 = ctx->name_buf; in fix_rsa_pss_saltlen()
1416 ctx->p2 = ctx->name_buf; in fix_rsa_pss_saltlen()
[all …]
H A Dpmeth_gn.c29 if (ctx == NULL) in gen_init()
35 if (ctx->keymgmt == NULL || ctx->keymgmt->gen_init == NULL) in gen_init()
72 ret = ctx->pmeth->paramgen_init(ctx); in gen_init()
76 ret = ctx->pmeth->keygen_init(ctx); in gen_init()
125 return ctx->pkey_gencb(ctx); in ossl_callback_to_pkey_gencb()
138 if (ctx == NULL) in EVP_PKEY_generate()
171 evp_pkey_export_to_provider(ctx->pkey, ctx->libctx, in EVP_PKEY_generate()
225 ret = ctx->pmeth->paramgen(ctx, *ppkey); in EVP_PKEY_generate()
228 ret = ctx->pmeth->keygen(ctx, *ppkey); in EVP_PKEY_generate()
297 return ctx->pkey_gencb(ctx); in trans_cb()
[all …]
H A Dpmeth_lib.c391 if (ctx->pmeth && ctx->pmeth->cleanup) in EVP_PKEY_CTX_free()
392 ctx->pmeth->cleanup(ctx); in EVP_PKEY_CTX_free()
943 if (ctx == NULL || (ctx->operation & op) == 0) { in evp_pkey_ctx_set_md()
990 if (ctx == NULL || (ctx->operation & op) == 0) { in evp_pkey_ctx_set1_octet_string()
1030 if (ctx == NULL || (ctx->operation & op) == 0) { in evp_pkey_ctx_add1_octet_string()
1151 if (ctx == NULL || !EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) { in EVP_PKEY_CTX_set_hkdf_mode()
1199 if (ctx == NULL || !EVP_PKEY_CTX_IS_DERIVE_OP(ctx)) { in evp_pkey_ctx_set_uint64()
1325 ret = ctx->pmeth->ctrl(ctx, cmd, p1, p2); in evp_pkey_ctx_ctrl_int()
1384 if (ctx == NULL || ctx->pmeth == NULL || ctx->pmeth->ctrl_str == NULL) { in evp_pkey_ctx_ctrl_str_int()
1590 return ctx->pmeth->ctrl(ctx, cmd, len, (void *)str); in EVP_PKEY_CTX_str2ctrl()
[all …]
/openssl/crypto/cmp/
H A Dcmp_ctx.c110 OSSL_CMP_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); in OSSL_CMP_CTX_new() local
112 if (ctx == NULL) in OSSL_CMP_CTX_new()
134 if (!cmp_ctx_set_md(ctx, &ctx->pbm_owf, NID_sha256)) in OSSL_CMP_CTX_new()
139 if (!cmp_ctx_set_md(ctx, &ctx->digest, NID_sha256)) in OSSL_CMP_CTX_new()
145 return ctx; in OSSL_CMP_CTX_new()
350 if (ctx == NULL || ctx->log_cb == NULL) in ossl_cmp_print_log()
414 if (ctx != NULL && OSSL_CMP_LOG_ERR > ctx->log_verbosity) in OSSL_CMP_CTX_print_errors()
416 OSSL_CMP_print_errors_cb(ctx == NULL ? NULL : ctx->log_cb); in OSSL_CMP_CTX_print_errors()
716 ctx->libctx, ctx->propq); in DEFINE_OSSL_set1_up_ref()
944 if (!cmp_ctx_set_md(ctx, &ctx->digest, val)) in DEFINE_set1_ASN1_OCTET_STRING()
[all …]
/openssl/providers/implementations/ciphers/
H A Dciphercommon_gcm.c75 if (!ctx->hw->setkey(ctx, key, ctx->keylen)) in gcm_init()
116 || !ctx->hw->setiv(ctx, ctx->iv, ctx->ivlen)) in getivgen()
120 memcpy(out, ctx->iv + ctx->ivlen - olen, olen); in getivgen()
125 ctr64_inc(ctx->iv + ctx->ivlen - 8); in getivgen()
137 memcpy(ctx->iv + ctx->ivlen - inl, in, inl); in setivinv()
138 if (!ctx->hw->setiv(ctx, ctx->iv, ctx->ivlen)) in setivinv()
440 if (!hw->setiv(ctx, ctx->iv, ctx->ivlen)) in gcm_cipher_internal()
459 if (!hw->cipherfinal(ctx, ctx->buf)) in gcm_cipher_internal()
508 memcpy(ctx->iv, iv, ctx->ivlen); in gcm_tls_iv_set_fixed()
520 if (RAND_bytes_ex(ctx->libctx, ctx->iv + len, ctx->ivlen - len, 0) <= 0) in gcm_tls_iv_set_fixed()
[all …]
H A Dcipher_chacha20_poly1305_hw.c37 ctx->chacha.counter[1] = ctx->nonce[0]; in chacha_poly1305_tls_init()
38 ctx->chacha.counter[2] = ctx->nonce[1] ^ CHACHA_U8TOU32(aad); in chacha_poly1305_tls_init()
39 ctx->chacha.counter[3] = ctx->nonce[2] ^ CHACHA_U8TOU32(aad+4); in chacha_poly1305_tls_init()
52 ctx->nonce[0] = ctx->chacha.counter[1] = CHACHA_U8TOU32(fixed); in chacha_poly1305_tls_iv_set_fixed()
65 ctx->aad = 0; in chacha20_poly1305_initkey()
84 ctx->aad = 0; in chacha20_poly1305_initiv()
98 ctx->nonce[0] = ctx->chacha.counter[1]; in chacha20_poly1305_initiv()
99 ctx->nonce[1] = ctx->chacha.counter[2]; in chacha20_poly1305_initiv()
100 ctx->nonce[2] = ctx->chacha.counter[3]; in chacha20_poly1305_initiv()
294 ctx->len.aad = ctx->len.text = 0; in chacha20_poly1305_aead_cipher()
[all …]
H A Dciphercommon_ccm.c32 len = ctx->buf[alen - 2] << 8 | ctx->buf[alen - 1]; in ccm_tls_init()
49 return ctx->m; in ccm_tls_init()
208 if (!ctx->enc || !ctx->tag_set) { in ossl_ccm_get_ctx_params()
216 if (!ctx->hw->gettag(ctx, p->data, p->data_size)) in ossl_ccm_get_ctx_params()
249 if (!ctx->hw->setkey(ctx, key, keylen)) in ccm_init()
329 if (!hw->setiv(ctx, ctx->iv, ccm_get_ivlen(ctx), mlen)) in ccm_set_iv()
360 if (!ctx->hw->setaad(ctx, ctx->buf, ctx->tls_aad_len)) in ccm_tls_cipher()
367 if (!ctx->hw->auth_encrypt(ctx, in, out, len, out + len, ctx->m)) in ccm_tls_cipher()
371 if (!ctx->hw->auth_decrypt(ctx, in, out, len, in ccm_tls_cipher()
417 if (!ctx->len_set && !ccm_set_iv(ctx, len)) in ccm_cipher_internal()
[all …]
H A Dciphercommon.c182 if (ctx != NULL && ctx->alloced) { in ossl_cipher_generic_reset_ctx()
211 memcpy(ctx->iv, ctx->oiv, ctx->ivlen); in cipher_generic_init_internal()
222 if (!ctx->hw->init(ctx, key, ctx->keylen)) in cipher_generic_init_internal()
349 if (ctx->bufsz == blksz && (ctx->enc || inl > 0 || !ctx->pad)) { in ossl_cipher_generic_block_update()
354 if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) { in ossl_cipher_generic_block_update()
429 if (!ctx->hw->cipher(ctx, out, ctx->buf, blksz)) { in ossl_cipher_generic_block_final()
440 if (ctx->bufsz == 0 && !ctx->pad) { in ossl_cipher_generic_block_final()
448 if (!ctx->hw->cipher(ctx, ctx->buf, ctx->buf, blksz)) { in ossl_cipher_generic_block_final()
453 if (ctx->pad && !ossl_cipher_unpadblock(ctx->buf, &ctx->bufsz, blksz)) { in ossl_cipher_generic_block_final()
462 memcpy(out, ctx->buf, ctx->bufsz); in ossl_cipher_generic_block_final()
[all …]
/openssl/crypto/modes/
H A Docb128.c155 memset(ctx, 0, sizeof(*ctx)); in CRYPTO_ocb128_init()
173 ctx->encrypt(ctx->l_star.c, ctx->l_star.c, ctx->keyenc); in CRYPTO_ocb128_init()
179 ocb_double(&ctx->l_dollar, ctx->l); in CRYPTO_ocb128_init()
182 ocb_double(ctx->l, ctx->l+1); in CRYPTO_ocb128_init()
183 ocb_double(ctx->l+1, ctx->l+2); in CRYPTO_ocb128_init()
184 ocb_double(ctx->l+2, ctx->l+3); in CRYPTO_ocb128_init()
185 ocb_double(ctx->l+3, ctx->l+4); in CRYPTO_ocb128_init()
240 ctx->encrypt(tmp, ktop, ctx->keyenc); in CRYPTO_ocb128_setiv()
393 ocb_block16_xor(&ctx->sess.offset, &ctx->l_star, &ctx->sess.offset); in CRYPTO_ocb128_encrypt()
396 ctx->encrypt(ctx->sess.offset.c, pad.c, ctx->keyenc); in CRYPTO_ocb128_encrypt()
[all …]
H A Dccm128.c30 memset(ctx->nonce.c, 0, sizeof(ctx->nonce.c)); in CRYPTO_ccm128_init()
78 (*block) (ctx->nonce.c, ctx->cmac.c, ctx->key), ctx->blocks++; in CRYPTO_ccm128_aad()
110 (*block) (ctx->cmac.c, ctx->cmac.c, ctx->key), ctx->blocks++; in CRYPTO_ccm128_aad()
152 (*block) (ctx->nonce.c, ctx->cmac.c, key), ctx->blocks++; in CRYPTO_ccm128_encrypt()
184 (*block) (ctx->cmac.c, ctx->cmac.c, key); in CRYPTO_ccm128_encrypt()
203 (*block) (ctx->cmac.c, ctx->cmac.c, key); in CRYPTO_ccm128_encrypt()
236 (*block) (ctx->nonce.c, ctx->cmac.c, key); in CRYPTO_ccm128_decrypt()
270 (*block) (ctx->cmac.c, ctx->cmac.c, key); in CRYPTO_ccm128_decrypt()
281 (*block) (ctx->cmac.c, ctx->cmac.c, key); in CRYPTO_ccm128_decrypt()
325 (*block) (ctx->nonce.c, ctx->cmac.c, key), ctx->blocks++; in CRYPTO_ccm128_encrypt_ccm64()
[all …]
H A Dgcm128.c328 # define GCM_MUL(ctx) ctx->funcs.gmult(ctx->Xi.u,ctx->Htable) argument
330 # define GHASH(ctx,in,len) ctx->funcs.ghash((ctx)->Xi.u,(ctx)->Htable,in,len) argument
628 ctx->funcs.ginit(ctx->Htable, ctx->H.u); in CRYPTO_gcm128_init()
706 (*ctx->block) (ctx->Yi.c, ctx->EK0.c, ctx->key); in CRYPTO_gcm128_setiv()
798 memcpy(ctx->Xn, ctx->Xi.c, sizeof(ctx->Xi)); in CRYPTO_gcm128_encrypt()
982 GHASH(ctx,ctx->Xn,sizeof(ctx->Xn)); in CRYPTO_gcm128_encrypt()
1023 memcpy(ctx->Xn, ctx->Xi.c, sizeof(ctx->Xi)); in CRYPTO_gcm128_decrypt()
1213 GHASH(ctx,ctx->Xn,sizeof(ctx->Xn)); in CRYPTO_gcm128_decrypt()
1258 memcpy(ctx->Xn, ctx->Xi.c, sizeof(ctx->Xi)); in CRYPTO_gcm128_encrypt_ctr32()
1359 (*ctx->block) (ctx->Yi.c, ctx->EKi.c, key); in CRYPTO_gcm128_encrypt_ctr32()
[all …]
/openssl/crypto/ts/
H A Dts_rsp_sign.c96 TS_RESP_CTX *ctx; in TS_RESP_CTX_new_ex() local
98 if ((ctx = OPENSSL_zalloc(sizeof(*ctx))) == NULL) in TS_RESP_CTX_new_ex()
113 return ctx; in TS_RESP_CTX_new_ex()
123 if (!ctx) in TS_RESP_CTX_free()
545 if ((serial = ctx->serial_cb(ctx, ctx->serial_cb_data)) == NULL in ts_RESP_create_tst_info()
548 if (!ctx->time_cb(ctx, ctx->time_cb_data, &sec, &usec) in ts_RESP_create_tst_info()
555 if ((ctx->seconds || ctx->millis || ctx->micros) in ts_RESP_create_tst_info()
620 ok = (*ctx->extension_cb) (ctx, ext, NULL); in ts_RESP_process_extensions()
691 if ((p7 = PKCS7_new_ex(ctx->libctx, ctx->propq)) == NULL) { in ts_RESP_sign()
731 certs = ctx->flags & TS_ESS_CERT_ID_CHAIN ? ctx->certs : NULL; in ts_RESP_sign()
[all …]
H A Dts_verify_ctx.c17 TS_VERIFY_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); in TS_VERIFY_CTX_new() local
19 return ctx; in TS_VERIFY_CTX_new()
25 memset(ctx, 0, sizeof(*ctx)); in TS_VERIFY_CTX_init()
30 if (!ctx) in TS_VERIFY_CTX_free()
39 ctx->flags |= f; in TS_VERIFY_CTX_add_flags()
45 ctx->flags = f; in TS_VERIFY_CTX_set_flags()
52 ctx->data = b; in TS_VERIFY_CTX_set_data()
60 ctx->data = b; in TS_VERIFY_CTX_set0_data()
67 ctx->store = s; in TS_VERIFY_CTX_set_store()
117 if (!ctx) in TS_VERIFY_CTX_cleanup()
[all …]
/openssl/crypto/x509/
H A Dx509_vfy.c167 return ctx->verify_cb(0, ctx); in verify_cb_cert()
184 return ctx->verify_cb(0, ctx); in verify_cb_crl()
223 return ctx->verify(ctx); in verify_rpk()
225 return !!ctx->verify_cb(ctx->error == X509_V_OK, ctx); in verify_rpk()
251 ok = ctx->verify != NULL ? ctx->verify(ctx) : internal_verify(ctx); in verify_chain()
268 ok = ctx->check_policy(ctx); in verify_chain()
303 if (!check_key_level(ctx, ctx->rpk) in x509_verify_rpk()
1799 if (!ctx->verify_cb(2, ctx)) in check_policy()
1856 if (!ctx->verify_cb(ctx->error == X509_V_OK, ctx)) in internal_verify()
1955 if (!ctx->verify_cb(1, ctx)) in internal_verify()
[all …]
/openssl/providers/implementations/digests/
H A Dsha3_prov.c98 ctx->meth.absorb(ctx, ctx->buf, bsz); in keccak_update()
102 rem = ctx->meth.absorb(ctx, inp, len); in keccak_update()
124 ret = ctx->meth.final(ctx, out, ctx->md_size); in keccak_final()
224 s390x_klmd(ctx->buf, ctx->bufsz, NULL, 0, fc, ctx->A); in s390x_sha3_final()
242 s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A); in s390x_shake_final()
263 s390x_klmd(ctx->buf, ctx->bufsz, out, outlen, fc, ctx->A); in s390x_shake_squeeze()
277 if (ctx->bufsz == ctx->block_size) in s390x_shake_squeeze()
283 ctx->bufsz = outlen % ctx->block_size; in s390x_shake_squeeze()
310 s390x_kimd(ctx->buf, bsz, fc, ctx->A); in s390x_keccakc_final()
350 ctx->buf[ctx->bufsz] = padding; in s390x_keccakc_squeeze()
[all …]
/openssl/ssl/quic/
H A Dquic_impl.c123 if (ctx->is_stream && ctx->xso != NULL) in quic_set_last_error()
125 else if (!ctx->is_stream && ctx->qc != NULL) in quic_set_last_error()
275 ctx->xso = ctx->qc->default_xso; in expect_quic_with_stream_lock()
765 ret = ctx.is_stream ? ctx.xso->ssl_options : ctx.qc->default_ssl_options; in quic_mask_or_options()
1433 if (ctx.qc->started || ctx.is_stream) in ossl_quic_set_connect_state()
1448 if (ctx.qc->started || ctx.is_stream) in ossl_quic_set_accept_state()
1908 wargs.ctx = ctx; in qc_wait_for_default_xso_for_read()
2111 last_error = ctx.is_stream ? ctx.xso->last_error : ctx.qc->last_error; in ossl_quic_get_error()
2793 ctx.xso = ctx.qc->default_xso; in quic_read()
2814 args.ctx = &ctx; in quic_read()
[all …]
/openssl/crypto/sha/
H A Dsha3.c23 memset(ctx->A, 0, sizeof(ctx->A)); in ossl_sha3_reset()
24 ctx->bufsz = 0; in ossl_sha3_reset()
36 ctx->pad = pad; in ossl_sha3_init()
80 (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz); in ossl_sha3_update()
81 ctx->bufsz = 0; in ossl_sha3_update()
120 ctx->buf[num] = ctx->pad; in ossl_sha3_final()
123 (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz); in ossl_sha3_final()
165 ctx->buf[num] = ctx->pad; in ossl_sha3_squeeze()
167 (void)SHA3_absorb(ctx->A, ctx->buf, bsz, bsz); in ossl_sha3_squeeze()
182 memcpy(out, ctx->buf + bsz - ctx->bufsz, len); in ossl_sha3_squeeze()
[all …]
/openssl/crypto/bio/
H A Dbf_buff.c47 BIO_F_BUFFER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); in buffer_new() local
49 if (ctx == NULL) in buffer_new()
107 memcpy(out, &(ctx->ibuf[ctx->ibuf_off]), i); in buffer_read()
143 i = BIO_read(b->next_bio, ctx->ibuf, ctx->ibuf_size); in buffer_read()
171 i = ctx->obuf_size - (ctx->obuf_len + ctx->obuf_off); in buffer_write()
174 memcpy(&(ctx->obuf[ctx->obuf_off + ctx->obuf_len]), in, inl); in buffer_write()
182 memcpy(&(ctx->obuf[ctx->obuf_off + ctx->obuf_len]), in, i); in buffer_write()
190 i = BIO_write(b->next_bio, &(ctx->obuf[ctx->obuf_off]), in buffer_write()
371 &(ctx->obuf[ctx->obuf_off]), ctx->obuf_len); in buffer_ctrl()
400 memcpy(ptr, &(ctx->ibuf[ctx->ibuf_off]), num); in buffer_ctrl()
[all …]
/openssl/providers/implementations/kdfs/
H A Dargon2.c590 t_data[l].ctx = ctx; in fill_mem_blocks_mt()
605 for (l = ctx->lanes - ctx->threads; l < ctx->lanes; ++l) { in fill_mem_blocks_mt()
777 blake2b_long(ctx->md, ctx->mac, out, ctx->outlen, blockhash_bytes, in finalize()
935 ctx = OPENSSL_zalloc(sizeof(*ctx)); in kdf_argon2d_new()
954 ctx = OPENSSL_zalloc(sizeof(*ctx)); in kdf_argon2i_new()
973 ctx = OPENSSL_zalloc(sizeof(*ctx)); in kdf_argon2id_new()
1009 memset(ctx, 0, sizeof(*ctx)); in kdf_argon2_free()
1026 ctx->mac = EVP_MAC_fetch(ctx->libctx, "blake2bmac", ctx->propq); in kdf_argon2_derive()
1034 ctx->md = EVP_MD_fetch(ctx->libctx, "blake2b512", ctx->propq); in kdf_argon2_derive()
1104 ctx->passes = ctx->t_cost; in kdf_argon2_derive()
[all …]
H A Dkbkdf.c121 ctx = OPENSSL_zalloc(sizeof(*ctx)); in kbkdf_new()
148 OPENSSL_clear_free(ctx->label, ctx->label_len); in kbkdf_reset()
149 OPENSSL_clear_free(ctx->ki, ctx->ki_len); in kbkdf_reset()
150 OPENSSL_clear_free(ctx->iv, ctx->iv_len); in kbkdf_reset()
151 memset(ctx, 0, sizeof(*ctx)); in kbkdf_reset()
309 if (ctx->ki_len == 0 || ctx->ki == NULL) { in kbkdf_derive()
335 if (ctx->iv_len != 0 && ctx->iv_len != h) { in kbkdf_derive()
356 ret = derive(ctx->ctx_init, ctx->mode, ctx->iv, ctx->iv_len, ctx->label, in kbkdf_derive()
357 ctx->label_len, ctx->context, ctx->context_len, k_i, h, l, in kbkdf_derive()
455 if ((ctx->is_kmac && !kmac_init(ctx->ctx_init, ctx->label, ctx->label_len)) in kbkdf_set_ctx_params()
[all …]
/openssl/crypto/cmac/
H A Dcmac.c56 CMAC_CTX *ctx; in CMAC_CTX_new() local
58 if ((ctx = OPENSSL_malloc(sizeof(*ctx))) == NULL) in CMAC_CTX_new()
66 return ctx; in CMAC_CTX_new()
86 if (!ctx) in CMAC_CTX_free()
158 if (EVP_Cipher(ctx->cctx, ctx->tbl, zero_iv, bl) <= 0) in ossl_cmac_init()
160 make_kn(ctx->k1, ctx->tbl, bl); in ossl_cmac_init()
161 make_kn(ctx->k2, ctx->k1, bl); in ossl_cmac_init()
207 if (EVP_Cipher(ctx->cctx, ctx->tbl, ctx->last_block, bl) <= 0) in CMAC_Update()
220 if (EVP_Cipher(ctx->cctx, ctx->tbl, data, bl) <= 0) in CMAC_Update()
264 out[i] = ctx->last_block[i] ^ ctx->k1[i]; in CMAC_Final()
[all …]

Completed in 148 milliseconds

12345678910>>...45