[CRYPTO] skcipher: Add top-level givencrypt/givdecrypt calls
[safe/jmp/linux-2.6] / include / crypto / algapi.h
index 726a765..60d06e7 100644 (file)
@@ -111,6 +111,12 @@ void crypto_drop_spawn(struct crypto_spawn *spawn);
 struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type,
                                    u32 mask);
 
+static inline void crypto_set_spawn(struct crypto_spawn *spawn,
+                                   struct crypto_instance *inst)
+{
+       spawn->inst = inst;
+}
+
 struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb);
 int crypto_check_attr_type(struct rtattr **tb, u32 type);
 const char *crypto_attr_alg_name(struct rtattr *rta);
@@ -192,15 +198,6 @@ static inline struct crypto_instance *crypto_aead_alg_instance(
        return crypto_tfm_alg_instance(&aead->base);
 }
 
-static inline struct crypto_ablkcipher *crypto_spawn_ablkcipher(
-       struct crypto_spawn *spawn)
-{
-       u32 type = CRYPTO_ALG_TYPE_BLKCIPHER;
-       u32 mask = CRYPTO_ALG_TYPE_BLKCIPHER_MASK;
-
-       return __crypto_ablkcipher_cast(crypto_spawn_tfm(spawn, type, mask));
-}
-
 static inline struct crypto_blkcipher *crypto_spawn_blkcipher(
        struct crypto_spawn *spawn)
 {
@@ -308,5 +305,14 @@ static inline struct crypto_alg *crypto_get_attr_alg(struct rtattr **tb,
        return crypto_attr_alg(tb[1], type, mask);
 }
 
+/*
+ * Returns CRYPTO_ALG_ASYNC if type/mask requires the use of sync algorithms.
+ * Otherwise returns zero.
+ */
+static inline int crypto_requires_sync(u32 type, u32 mask)
+{
+       return (type ^ CRYPTO_ALG_ASYNC) & mask & CRYPTO_ALG_ASYNC;
+}
+
 #endif /* _CRYPTO_ALGAPI_H */