aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto/internal/skcipher.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2015-08-20 15:21:45 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2015-08-21 22:21:19 +0800
commit7a7ffe65c8c5fbf272b132d8980b2511d5e5fc98 (patch)
tree23ca20c505ed5638a806d1d8f6ce9ff063e70bf8 /include/crypto/internal/skcipher.h
parentcrypto: cmac - allow usage in FIPS mode (diff)
downloadlinux-dev-7a7ffe65c8c5fbf272b132d8980b2511d5e5fc98.tar.xz
linux-dev-7a7ffe65c8c5fbf272b132d8980b2511d5e5fc98.zip
crypto: skcipher - Add top-level skcipher interface
This patch introduces the crypto skcipher interface which aims to replace both blkcipher and ablkcipher. It's very similar to the existing ablkcipher interface. The main difference is the removal of the givcrypt interface. In order to make the transition easier for blkcipher users, there is a helper SKCIPHER_REQUEST_ON_STACK which can be used to place a request on the stack for synchronous transforms. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--include/crypto/internal/skcipher.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h
index b3a46c515d1b..2cf7a61ece59 100644
--- a/include/crypto/internal/skcipher.h
+++ b/include/crypto/internal/skcipher.h
@@ -107,5 +107,20 @@ static inline u32 ablkcipher_request_flags(struct ablkcipher_request *req)
return req->base.flags;
}
+static inline void *crypto_skcipher_ctx(struct crypto_skcipher *tfm)
+{
+ return crypto_tfm_ctx(&tfm->base);
+}
+
+static inline void *skcipher_request_ctx(struct skcipher_request *req)
+{
+ return req->__ctx;
+}
+
+static inline u32 skcipher_request_flags(struct skcipher_request *req)
+{
+ return req->base.flags;
+}
+
#endif /* _CRYPTO_INTERNAL_SKCIPHER_H */