cipher_ctx
EVP_CIPHER_CTX_free(ctx->cipher_ctx);
ctx->cipher_ctx = NULL;
if ((ctx->cipher_ctx = EVP_CIPHER_CTX_new()) == NULL
|| !EVP_EncryptInit_ex(ctx->cipher_ctx, ctr, NULL, key + klen, NULL)
EVP_CIPHER_CTX_free(ctx->cipher_ctx);
ctx->cipher_ctx = NULL;
if (dest->cipher_ctx == NULL) {
dest->cipher_ctx = EVP_CIPHER_CTX_new();
if (dest->cipher_ctx == NULL)
if (!EVP_CIPHER_CTX_copy(dest->cipher_ctx, src->cipher_ctx))
if (!siv128_do_encrypt(ctx->cipher_ctx, out, in, len, &q))
if (!siv128_do_encrypt(ctx->cipher_ctx, out, in, len, &q)
EVP_CIPHER_CTX_free(ctx->cipher_ctx);
ctx->cipher_ctx = NULL;
struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
if (cipher_ctx->sess.ses != 0 && clean_devcrypto_session(&cipher_ctx->sess) == 0)
cipher_ctx->sess.cipher = cipher_d->devcryptoid;
cipher_ctx->sess.keylen = cipher_d->keylen;
cipher_ctx->sess.key = (void *)key;
cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
cipher_ctx->blocksize = cipher_d->blocksize;
cipher_ctx->sess.crid = (use_softdrivers == DEVCRYPTO_USE_SOFTWARE) ? CRYPTO_FLAG_SOFTWARE | CRYPTO_FLAG_HARDWARE : CRYPTO_FLAG_HARDWARE;
ret = ioctl(cfd, CIOCGSESSION2, &cipher_ctx->sess);
ret = ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess);
struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
cryp.ses = cipher_ctx->sess.ses;
cryp.op = cipher_ctx->op;
switch (cipher_ctx->mode) {
switch (cipher_ctx->mode) {
nblocks = (inl + cipher_ctx->blocksize - 1)
/ cipher_ctx->blocksize;
struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
while (cipher_ctx->num && inl) {
(*out++) = *(in++) ^ cipher_ctx->partial[cipher_ctx->num];
cipher_ctx->num = (cipher_ctx->num + 1) % cipher_ctx->blocksize;
if (inl > cipher_ctx->blocksize) {
nblocks = inl / cipher_ctx->blocksize;
len = nblocks * cipher_ctx->blocksize;
memset(cipher_ctx->partial, 0, cipher_ctx->blocksize);
if (cipher_do_cipher(ctx, cipher_ctx->partial, cipher_ctx->partial,
cipher_ctx->blocksize)
out[cipher_ctx->num] = in[cipher_ctx->num]
^ cipher_ctx->partial[cipher_ctx->num];
cipher_ctx->num++;
struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
struct cipher_ctx *to_cipher_ctx;
if (cipher_ctx == NULL)
to_cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(to_ctx);
return cipher_init(to_ctx, (void *)cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx),
(cipher_ctx->op == COP_ENCRYPT));
memset(&cipher_ctx->sess, 0, sizeof(cipher_ctx->sess));
struct cipher_ctx *cipher_ctx = (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
return clean_devcrypto_session(&cipher_ctx->sess);
sizeof(struct cipher_ctx))) {
EVP_CIPHER_CTX *cipher_ctx;
EVP_CIPHER_CTX *cipher_ctx;
out->siv.cipher_ctx = NULL;
if (!EVP_CipherInit_ex(hpr->cipher_ctx, NULL, NULL, NULL, sample, 1)
|| !EVP_CipherUpdate(hpr->cipher_ctx, mask, &l,
hpr->cipher_ctx = EVP_CIPHER_CTX_new();
if (hpr->cipher_ctx == NULL) {
if (!EVP_CipherInit_ex(hpr->cipher_ctx, hpr->cipher, NULL,
EVP_CIPHER_CTX_free(hpr->cipher_ctx);
hpr->cipher_ctx = NULL;
if (!EVP_CipherInit_ex(hpr->cipher_ctx, NULL, NULL, NULL, NULL, 1)
|| !EVP_CipherUpdate(hpr->cipher_ctx, dst, &l, sample, 16)) {