]> git.ipfire.org Git - people/ms/linux.git/blobdiff - include/crypto/aead.h
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[people/ms/linux.git] / include / crypto / aead.h
index 61bb10490492d93b395aa9ae0d8d4242158baef5..3c245b1859e777d6d713d81392fd2c25a8d60b55 100644 (file)
@@ -317,21 +317,7 @@ static inline struct crypto_aead *crypto_aead_reqtfm(struct aead_request *req)
  *
  * Return: 0 if the cipher operation was successful; < 0 if an error occurred
  */
-static inline int crypto_aead_encrypt(struct aead_request *req)
-{
-       struct crypto_aead *aead = crypto_aead_reqtfm(req);
-       struct crypto_alg *alg = aead->base.__crt_alg;
-       unsigned int cryptlen = req->cryptlen;
-       int ret;
-
-       crypto_stats_get(alg);
-       if (crypto_aead_get_flags(aead) & CRYPTO_TFM_NEED_KEY)
-               ret = -ENOKEY;
-       else
-               ret = crypto_aead_alg(aead)->encrypt(req);
-       crypto_stats_aead_encrypt(cryptlen, alg, ret);
-       return ret;
-}
+int crypto_aead_encrypt(struct aead_request *req);
 
 /**
  * crypto_aead_decrypt() - decrypt ciphertext
@@ -355,23 +341,7 @@ static inline int crypto_aead_encrypt(struct aead_request *req)
  *        integrity of the ciphertext or the associated data was violated);
  *        < 0 if an error occurred.
  */
-static inline int crypto_aead_decrypt(struct aead_request *req)
-{
-       struct crypto_aead *aead = crypto_aead_reqtfm(req);
-       struct crypto_alg *alg = aead->base.__crt_alg;
-       unsigned int cryptlen = req->cryptlen;
-       int ret;
-
-       crypto_stats_get(alg);
-       if (crypto_aead_get_flags(aead) & CRYPTO_TFM_NEED_KEY)
-               ret = -ENOKEY;
-       else if (req->cryptlen < crypto_aead_authsize(aead))
-               ret = -EINVAL;
-       else
-               ret = crypto_aead_alg(aead)->decrypt(req);
-       crypto_stats_aead_decrypt(cryptlen, alg, ret);
-       return ret;
-}
+int crypto_aead_decrypt(struct aead_request *req);
 
 /**
  * DOC: Asynchronous AEAD Request Handle