]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - include/crypto/internal/skcipher.h
[CRYPTO] chainiv: Avoid lock spinning where possible
[linux-2.6.git] / include / crypto / internal / skcipher.h
index 80c5bfb14a6031fe74b3bb6fabeea0ec2335f8c0..2ba42cd7d6aa4c4fa708ba2733b6a20a59c3c526 100644 (file)
@@ -53,6 +53,8 @@ static inline struct crypto_ablkcipher *crypto_spawn_skcipher(
                                 crypto_skcipher_mask(0)));
 }
 
+int skcipher_null_givencrypt(struct skcipher_givcrypt_request *req);
+int skcipher_null_givdecrypt(struct skcipher_givcrypt_request *req);
 const char *crypto_default_geniv(const struct crypto_alg *alg);
 
 struct crypto_instance *skcipher_geniv_alloc(struct crypto_template *tmpl,
@@ -68,6 +70,19 @@ static inline struct crypto_ablkcipher *skcipher_geniv_cipher(
        return crypto_ablkcipher_crt(geniv)->base;
 }
 
+static inline int skcipher_enqueue_givcrypt(
+       struct crypto_queue *queue, struct skcipher_givcrypt_request *request)
+{
+       return ablkcipher_enqueue_request(queue, &request->creq);
+}
+
+static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt(
+       struct crypto_queue *queue)
+{
+       return container_of(ablkcipher_dequeue_request(queue),
+                           struct skcipher_givcrypt_request, creq);
+}
+
 static inline void *skcipher_givcrypt_reqctx(
        struct skcipher_givcrypt_request *req)
 {
@@ -86,5 +101,10 @@ static inline void skcipher_givcrypt_complete(
        ablkcipher_request_complete(&req->creq, err);
 }
 
+static inline u32 ablkcipher_request_flags(struct ablkcipher_request *req)
+{
+       return req->base.flags;
+}
+
 #endif /* _CRYPTO_INTERNAL_SKCIPHER_H */