essiv.c (b9f76dddb1f9f70e008b982381bbc9a67c9b8c66) | essiv.c (cd900f0cacd7601dabdd028e8cbdbf2a7041cee2) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * ESSIV skcipher and aead template for block encryption 4 * 5 * This template encapsulates the ESSIV IV generation algorithm used by 6 * dm-crypt and fscrypt, which converts the initial vector for the skcipher 7 * used for block encryption, by encrypting it using the hash of the 8 * skcipher key as encryption key. Usually, the input IV is a 64-bit sector --- 486 unchanged lines hidden (view full) --- 495 sizeof(*ictx), GFP_KERNEL); 496 if (!aead_inst) 497 return -ENOMEM; 498 inst = aead_crypto_instance(aead_inst); 499 base = &aead_inst->alg.base; 500 ictx = crypto_instance_ctx(inst); 501 502 /* AEAD cipher, e.g., "authenc(hmac(sha256),cbc(aes))" */ | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * ESSIV skcipher and aead template for block encryption 4 * 5 * This template encapsulates the ESSIV IV generation algorithm used by 6 * dm-crypt and fscrypt, which converts the initial vector for the skcipher 7 * used for block encryption, by encrypting it using the hash of the 8 * skcipher key as encryption key. Usually, the input IV is a 64-bit sector --- 486 unchanged lines hidden (view full) --- 495 sizeof(*ictx), GFP_KERNEL); 496 if (!aead_inst) 497 return -ENOMEM; 498 inst = aead_crypto_instance(aead_inst); 499 base = &aead_inst->alg.base; 500 ictx = crypto_instance_ctx(inst); 501 502 /* AEAD cipher, e.g., "authenc(hmac(sha256),cbc(aes))" */ |
503 crypto_set_aead_spawn(&ictx->u.aead_spawn, inst); 504 err = crypto_grab_aead(&ictx->u.aead_spawn, | 503 err = crypto_grab_aead(&ictx->u.aead_spawn, inst, |
505 inner_cipher_name, 0, mask); 506 if (err) 507 goto out_free_inst; 508 aead_alg = crypto_spawn_aead_alg(&ictx->u.aead_spawn); 509 block_base = &aead_alg->base; 510 if (!strstarts(block_base->cra_name, "authenc(")) { 511 pr_warn("Only authenc() type AEADs are supported by ESSIV\n"); 512 err = -EINVAL; --- 131 unchanged lines hidden --- | 504 inner_cipher_name, 0, mask); 505 if (err) 506 goto out_free_inst; 507 aead_alg = crypto_spawn_aead_alg(&ictx->u.aead_spawn); 508 block_base = &aead_alg->base; 509 if (!strstarts(block_base->cra_name, "authenc(")) { 510 pr_warn("Only authenc() type AEADs are supported by ESSIV\n"); 511 err = -EINVAL; --- 131 unchanged lines hidden --- |