mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[CRYPTO] aead: Make authsize a run-time parameter
As it is authsize is an algorithm paramter which cannot be changed at run-time. This is inconvenient because hardware that implements such algorithms would have to register each authsize that they support separately. Since authsize is a property common to all AEAD algorithms, we can add a function setauthsize that sets it at run-time, just like setkey. This patch does exactly that and also changes authenc so that authsize is no longer a parameter of its template. Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
e29bc6ad0e
commit
7ba683a6de
4 changed files with 38 additions and 32 deletions
|
|
@ -414,7 +414,7 @@ static struct crypto_instance *crypto_gcm_alloc(struct rtattr **tb)
|
|||
inst->alg.cra_alignmask = __alignof__(u32) - 1;
|
||||
inst->alg.cra_type = &crypto_aead_type;
|
||||
inst->alg.cra_aead.ivsize = 12;
|
||||
inst->alg.cra_aead.authsize = 16;
|
||||
inst->alg.cra_aead.maxauthsize = 16;
|
||||
inst->alg.cra_ctxsize = sizeof(struct crypto_gcm_ctx);
|
||||
inst->alg.cra_init = crypto_gcm_init_tfm;
|
||||
inst->alg.cra_exit = crypto_gcm_exit_tfm;
|
||||
|
|
|
|||
Loading…
Reference in a new issue