Skip to content
Snippets Groups Projects
Commit aedb30dc authored by Herbert Xu's avatar Herbert Xu
Browse files

[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: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 3a282bd2
No related branches found
No related tags found
No related merge requests found
...@@ -77,7 +77,7 @@ static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type, ...@@ -77,7 +77,7 @@ static unsigned int crypto_aead_ctxsize(struct crypto_alg *alg, u32 type,
return alg->cra_ctxsize; return alg->cra_ctxsize;
} }
static int no_givdecrypt(struct aead_givcrypt_request *req) static int no_givcrypt(struct aead_givcrypt_request *req)
{ {
return -ENOSYS; return -ENOSYS;
} }
...@@ -93,8 +93,8 @@ static int crypto_init_aead_ops(struct crypto_tfm *tfm, u32 type, u32 mask) ...@@ -93,8 +93,8 @@ static int crypto_init_aead_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
crt->setkey = setkey; crt->setkey = setkey;
crt->encrypt = alg->encrypt; crt->encrypt = alg->encrypt;
crt->decrypt = alg->decrypt; crt->decrypt = alg->decrypt;
crt->givencrypt = alg->givencrypt; crt->givencrypt = alg->givencrypt ?: no_givcrypt;
crt->givdecrypt = alg->givdecrypt ?: no_givdecrypt; crt->givdecrypt = alg->givdecrypt ?: no_givcrypt;
crt->ivsize = alg->ivsize; crt->ivsize = alg->ivsize;
crt->authsize = alg->maxauthsize; crt->authsize = alg->maxauthsize;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment