Lines Matching defs:ctx
61 EVP_CIPHER_CTX *ctx;
88 ctx = EVP_CIPHER_CTX_new();
89 if (ctx == NULL)
92 EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv);
96 if (!EVP_EncryptUpdate(ctx, obuf, &len, ibuf, r))
105 if (!EVP_EncryptFinal_ex(ctx, obuf, &len))
111 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, sizeof tag, tag);
119 EVP_CIPHER_CTX_free(ctx);
126 EVP_CIPHER_CTX *ctx;
170 ctx = EVP_CIPHER_CTX_new();
171 if (ctx == NULL)
174 EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv);
177 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof tag, tag);
187 if (!EVP_DecryptUpdate(ctx, obuf, &len, ibuf, r))
197 if (!EVP_DecryptFinal_ex(ctx, obuf, &len))
206 EVP_CIPHER_CTX_free(ctx);
213 EVP_CIPHER_CTX *ctx;
241 ctx = EVP_CIPHER_CTX_new();
242 if (ctx == NULL)
245 EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv);
248 if (!EVP_EncryptUpdate(ctx, out + len, &olen, in, inlen))
253 if (!EVP_EncryptFinal_ex(ctx, out + len, &olen))
258 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_GET_TAG, sizeof tag, tag);
263 EVP_CIPHER_CTX_free(ctx);
270 EVP_CIPHER_CTX *ctx;
297 ctx = EVP_CIPHER_CTX_new();
298 if (ctx == NULL)
301 EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, cp.key, iv);
304 EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_TAG, sizeof tag, tag);
307 if (!EVP_DecryptUpdate(ctx, out, &olen, in, inlen))
312 if (!EVP_DecryptFinal_ex(ctx, out + len, &olen))
317 EVP_CIPHER_CTX_free(ctx);