Source
54
54
const u8 *key, unsigned int keylen)
55
55
{
56
56
unsigned long alignmask = crypto_aead_alignmask(tfm);
57
57
int err;
58
58
59
59
if ((unsigned long)key & alignmask)
60
60
err = setkey_unaligned(tfm, key, keylen);
61
61
else
62
62
err = crypto_aead_alg(tfm)->setkey(tfm, key, keylen);
63
63
64
-
if (err)
64
+
if (unlikely(err)) {
65
+
crypto_aead_set_flags(tfm, CRYPTO_TFM_NEED_KEY);
65
66
return err;
67
+
}
66
68
67
69
crypto_aead_clear_flags(tfm, CRYPTO_TFM_NEED_KEY);
68
70
return 0;
69
71
}
70
72
EXPORT_SYMBOL_GPL(crypto_aead_setkey);
71
73
72
74
int crypto_aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize)
73
75
{
74
76
int err;
75
77