Skip to content

Commit

Permalink
crypto: geniv - remove unneeded arguments from aead_geniv_alloc()
Browse files Browse the repository at this point in the history
The type and mask arguments to aead_geniv_alloc() are always 0, so
remove them.

Signed-off-by: Eric Biggers <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ebiggers authored and herbertx committed Jul 16, 2020
1 parent d7866e5 commit e72b48c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion crypto/echainiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int echainiv_aead_create(struct crypto_template *tmpl,
struct aead_instance *inst;
int err;

inst = aead_geniv_alloc(tmpl, tb, 0, 0);
inst = aead_geniv_alloc(tmpl, tb);

if (IS_ERR(inst))
return PTR_ERR(inst);
Expand Down
7 changes: 4 additions & 3 deletions crypto/geniv.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ static void aead_geniv_free(struct aead_instance *inst)
}

struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
struct rtattr **tb, u32 type, u32 mask)
struct rtattr **tb)
{
struct crypto_aead_spawn *spawn;
struct crypto_attr_type *algt;
struct aead_instance *inst;
struct aead_alg *alg;
unsigned int ivsize;
unsigned int maxauthsize;
u32 mask;
int err;

algt = crypto_get_attr_type(tb);
Expand All @@ -63,10 +64,10 @@ struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
spawn = aead_instance_ctx(inst);

/* Ignore async algorithms if necessary. */
mask |= crypto_requires_sync(algt->type, algt->mask);
mask = crypto_requires_sync(algt->type, algt->mask);

err = crypto_grab_aead(spawn, aead_crypto_instance(inst),
crypto_attr_alg_name(tb[1]), type, mask);
crypto_attr_alg_name(tb[1]), 0, mask);
if (err)
goto err_free_inst;

Expand Down
2 changes: 1 addition & 1 deletion crypto/seqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static int seqiv_aead_create(struct crypto_template *tmpl, struct rtattr **tb)
struct aead_instance *inst;
int err;

inst = aead_geniv_alloc(tmpl, tb, 0, 0);
inst = aead_geniv_alloc(tmpl, tb);

if (IS_ERR(inst))
return PTR_ERR(inst);
Expand Down
2 changes: 1 addition & 1 deletion include/crypto/internal/geniv.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct aead_geniv_ctx {
};

struct aead_instance *aead_geniv_alloc(struct crypto_template *tmpl,
struct rtattr **tb, u32 type, u32 mask);
struct rtattr **tb);
int aead_init_geniv(struct crypto_aead *tfm);
void aead_exit_geniv(struct crypto_aead *tfm);

Expand Down

0 comments on commit e72b48c

Please sign in to comment.