From: Herbert Xu Date: Wed, 12 Dec 2007 11:27:25 +0000 (+0800) Subject: [CRYPTO] aead: Allow algorithms with no givcrypt support X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aedb30dc49eeecd48558b601c47e0b3f9e42c602;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [CRYPTO] aead: Allow algorithms with no givcrypt support Some algorithms always require manual IV construction. For instance, the generic CCM algorithm requires the first byte of the IV to be manually constructed. Such algorithms are always used by other algorithms equipped with their own IV generators and do not need IV generation per se. Signed-off-by: Herbert Xu --- diff --git a/crypto/aead.c b/crypto/aead.c index 0402b606fcfd..15335ed9010a 100644 --- a/crypto/aead.c +++ b/crypto/aead.c @@ -77,7 +77,7 @@ static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type, return alg->cra_ctxsize; } -static int no_givdecrypt(struct aead_givcrypt_request *req) +static int no_givcrypt(struct aead_givcrypt_request *req) { return -ENOSYS; } @@ -93,8 +93,8 @@ static int crypto_init_aead_ops(struct crypto_tfm *tfm, u32 type, u32 mask) crt->setkey = setkey; crt->encrypt = alg->encrypt; crt->decrypt = alg->decrypt; - crt->givencrypt = alg->givencrypt; - crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt; + crt->givencrypt = alg->givencrypt ?: no_givcrypt; + crt->givdecrypt = alg->givdecrypt ?: no_givcrypt; crt->ivsize = alg->ivsize; crt->authsize = alg->maxauthsize;