mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
crypto: hash - Make setkey optional
Since most cryptographic hash algorithms have no keys, this patch makes the setkey function optional for ahash and shash. Signed-off-by: Herbert Xu <[email protected]>
This commit is contained in:
parent
b812eb0076
commit
3751f402e0
2 changed files with 10 additions and 1 deletions
|
|
@ -55,6 +55,9 @@ int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key,
|
|||
struct shash_alg *shash = crypto_shash_alg(tfm);
|
||||
unsigned long alignmask = crypto_shash_alignmask(tfm);
|
||||
|
||||
if (!shash->setkey)
|
||||
return -ENOSYS;
|
||||
|
||||
if ((unsigned long)key & alignmask)
|
||||
return shash_setkey_unaligned(tfm, key, keylen);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue