Lines Matching refs:ctx
25 EVP_KDF_CTX *ctx = NULL;
30 ctx = OPENSSL_zalloc(sizeof(EVP_KDF_CTX));
31 if (ctx == NULL
32 || (ctx->algctx = kdf->newctx(ossl_provider_ctx(kdf->prov))) == NULL
35 if (ctx != NULL)
36 kdf->freectx(ctx->algctx);
37 OPENSSL_free(ctx);
38 ctx = NULL;
40 ctx->meth = kdf;
42 return ctx;
45 void EVP_KDF_CTX_free(EVP_KDF_CTX *ctx)
47 if (ctx == NULL)
49 ctx->meth->freectx(ctx->algctx);
50 ctx->algctx = NULL;
51 EVP_KDF_free(ctx->meth);
52 OPENSSL_free(ctx);
108 const EVP_KDF *EVP_KDF_CTX_kdf(EVP_KDF_CTX *ctx)
110 return ctx->meth;
113 void EVP_KDF_CTX_reset(EVP_KDF_CTX *ctx)
115 if (ctx == NULL)
118 if (ctx->meth->reset != NULL)
119 ctx->meth->reset(ctx->algctx);
122 size_t EVP_KDF_CTX_get_kdf_size(EVP_KDF_CTX *ctx)
127 if (ctx == NULL)
131 if (ctx->meth->get_ctx_params != NULL
132 && ctx->meth->get_ctx_params(ctx->algctx, params))
134 if (ctx->meth->get_params != NULL
135 && ctx->meth->get_params(params))
140 int EVP_KDF_derive(EVP_KDF_CTX *ctx, unsigned char *key, size_t keylen,
143 if (ctx == NULL)
146 return ctx->meth->derive(ctx->algctx, key, keylen, params);
162 int EVP_KDF_CTX_get_params(EVP_KDF_CTX *ctx, OSSL_PARAM params[])
164 if (ctx->meth->get_ctx_params != NULL)
165 return ctx->meth->get_ctx_params(ctx->algctx, params);
169 int EVP_KDF_CTX_set_params(EVP_KDF_CTX *ctx, const OSSL_PARAM params[])
171 if (ctx->meth->set_ctx_params != NULL)
172 return ctx->meth->set_ctx_params(ctx->algctx, params);