Lines Matching defs:ossl_ctx
114 struct ossl_cipher_ctx *ossl_ctx = ctx->cipher_data; /* EVP_CIPHER_CTX wrapper */
117 assert(ossl_ctx != NULL);
134 c = ossl_ctx->ossl_cipher = ctx->cipher->app_data; /* OpenSSL's EVP_CIPHER * */
135 if (!ossl_ctx->initialized) {
136 ossl_ctx->ossl_cipher_ctx = EVP_CIPHER_CTX_new();
137 if (ossl_ctx->ossl_cipher_ctx == NULL)
143 if (!EVP_CipherInit_ex(ossl_ctx->ossl_cipher_ctx, c, NULL, NULL, NULL, enc))
145 ossl_ctx->initialized = 1;
151 EVP_CIPHER_CTX_set_key_length(ossl_ctx->ossl_cipher_ctx, ctx->key_len);
153 return EVP_CipherInit_ex(ossl_ctx->ossl_cipher_ctx, NULL, NULL, key, iv, enc);
160 struct ossl_cipher_ctx *ossl_ctx = ctx->cipher_data;
162 assert(ossl_ctx != NULL);
163 return EVP_Cipher(ossl_ctx->ossl_cipher_ctx, out, in, len);
169 struct ossl_cipher_ctx *ossl_ctx = ctx->cipher_data;
171 if (ossl_ctx == NULL || !ossl_ctx->initialized)
174 if (ossl_ctx->ossl_cipher_ctx != NULL)
175 EVP_CIPHER_CTX_free(ossl_ctx->ossl_cipher_ctx);
177 ossl_ctx->ossl_cipher_ctx = NULL;
178 ossl_ctx->ossl_cipher = NULL;
179 ossl_ctx->initialized = 0;
186 struct ossl_cipher_ctx *ossl_ctx = ctx->cipher_data;
188 assert(ossl_ctx != NULL);
189 return EVP_CIPHER_CTX_ctrl(ossl_ctx->ossl_cipher_ctx, type, arg, ptr);