aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/skcipher.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/crypto/skcipher.h')
-rw-r--r--include/crypto/skcipher.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/crypto/skcipher.h b/include/crypto/skcipher.h
index 562001cb412b..2f327f090c3e 100644
--- a/include/crypto/skcipher.h
+++ b/include/crypto/skcipher.h
@@ -401,11 +401,6 @@ static inline int crypto_skcipher_setkey(struct crypto_skcipher *tfm,
401 return tfm->setkey(tfm, key, keylen); 401 return tfm->setkey(tfm, key, keylen);
402} 402}
403 403
404static inline bool crypto_skcipher_has_setkey(struct crypto_skcipher *tfm)
405{
406 return tfm->keysize;
407}
408
409static inline unsigned int crypto_skcipher_default_keysize( 404static inline unsigned int crypto_skcipher_default_keysize(
410 struct crypto_skcipher *tfm) 405 struct crypto_skcipher *tfm)
411{ 406{
@@ -442,6 +437,9 @@ static inline int crypto_skcipher_encrypt(struct skcipher_request *req)
442{ 437{
443 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); 438 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
444 439
440 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
441 return -ENOKEY;
442
445 return tfm->encrypt(req); 443 return tfm->encrypt(req);
446} 444}
447 445
@@ -460,6 +458,9 @@ static inline int crypto_skcipher_decrypt(struct skcipher_request *req)
460{ 458{
461 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); 459 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
462 460
461 if (crypto_skcipher_get_flags(tfm) & CRYPTO_TFM_NEED_KEY)
462 return -ENOKEY;
463
463 return tfm->decrypt(req); 464 return tfm->decrypt(req);
464} 465}
465 466