2 * Symmetric key ciphers.
4 * Copyright (c) 2007 Herbert Xu <herbert@gondor.apana.org.au>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2 of the License, or (at your option)
13 #ifndef _CRYPTO_INTERNAL_SKCIPHER_H
14 #define _CRYPTO_INTERNAL_SKCIPHER_H
16 #include <crypto/algapi.h>
17 #include <crypto/skcipher.h>
19 struct crypto_skcipher_spawn {
20 struct crypto_spawn base;
23 extern const struct crypto_type crypto_givcipher_type;
25 static inline void crypto_set_skcipher_spawn(
26 struct crypto_skcipher_spawn *spawn, struct crypto_instance *inst)
28 crypto_set_spawn(&spawn->base, inst);
31 int crypto_grab_skcipher(struct crypto_skcipher_spawn *spawn, const char *name,
34 static inline void crypto_drop_skcipher(struct crypto_skcipher_spawn *spawn)
36 crypto_drop_spawn(&spawn->base);
39 static inline struct crypto_alg *crypto_skcipher_spawn_alg(
40 struct crypto_skcipher_spawn *spawn)
42 return spawn->base.alg;
45 static inline struct crypto_ablkcipher *crypto_spawn_skcipher(
46 struct crypto_skcipher_spawn *spawn)
48 return __crypto_ablkcipher_cast(
49 crypto_spawn_tfm(&spawn->base, crypto_skcipher_type(0),
50 crypto_skcipher_mask(0)));
53 static inline void *skcipher_givcrypt_reqctx(
54 struct skcipher_givcrypt_request *req)
56 return ablkcipher_request_ctx(&req->creq);
59 #endif /* _CRYPTO_INTERNAL_SKCIPHER_H */