diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2006-12-16 18:05:58 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2007-02-06 17:21:01 -0500 |
commit | 2e306ee016fd4750289e65c3b1856db569f1f3f2 (patch) | |
tree | 53ace6081967c640f052d53397250657af855c25 /crypto/pcbc.c | |
parent | f1ddcaf3393b7a3871809b97fae90fac841a1f39 (diff) |
[CRYPTO] api: Add type-safe spawns
This patch allows spawns of specific types (e.g., cipher) to be allocated.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/pcbc.c')
-rw-r--r-- | crypto/pcbc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/pcbc.c b/crypto/pcbc.c index 0ffb46eb259f..5174d7fdad6e 100644 --- a/crypto/pcbc.c +++ b/crypto/pcbc.c | |||
@@ -247,6 +247,7 @@ static int crypto_pcbc_init_tfm(struct crypto_tfm *tfm) | |||
247 | struct crypto_instance *inst = (void *)tfm->__crt_alg; | 247 | struct crypto_instance *inst = (void *)tfm->__crt_alg; |
248 | struct crypto_spawn *spawn = crypto_instance_ctx(inst); | 248 | struct crypto_spawn *spawn = crypto_instance_ctx(inst); |
249 | struct crypto_pcbc_ctx *ctx = crypto_tfm_ctx(tfm); | 249 | struct crypto_pcbc_ctx *ctx = crypto_tfm_ctx(tfm); |
250 | struct crypto_cipher *cipher; | ||
250 | 251 | ||
251 | switch (crypto_tfm_alg_blocksize(tfm)) { | 252 | switch (crypto_tfm_alg_blocksize(tfm)) { |
252 | case 8: | 253 | case 8: |
@@ -264,11 +265,11 @@ static int crypto_pcbc_init_tfm(struct crypto_tfm *tfm) | |||
264 | ctx->xor = xor_quad; | 265 | ctx->xor = xor_quad; |
265 | } | 266 | } |
266 | 267 | ||
267 | tfm = crypto_spawn_tfm(spawn); | 268 | cipher = crypto_spawn_cipher(spawn); |
268 | if (IS_ERR(tfm)) | 269 | if (IS_ERR(cipher)) |
269 | return PTR_ERR(tfm); | 270 | return PTR_ERR(cipher); |
270 | 271 | ||
271 | ctx->child = crypto_cipher_cast(tfm); | 272 | ctx->child = cipher; |
272 | return 0; | 273 | return 0; |
273 | } | 274 | } |
274 | 275 | ||