Skip to content

Commit

Permalink
[CRYPTO] aead: Allow algorithms with no givcrypt support
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx committed Jan 10, 2008
1 parent 3a282bd commit aedb30d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crypto/aead.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;

Expand Down

0 comments on commit aedb30d

Please sign in to comment.