diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-06 17:04:06 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-06 17:04:06 -0700 |
commit | 359ea2f1352a77177540a213283bc7489f546ced (patch) | |
tree | 95a313a9d920e432bafcdf68a9c7fb0812aa389b /crypto/internal.h | |
parent | 960b8466548c9bc6f718b5f470c1a58000fab09d (diff) | |
parent | e1d5dea1dfbfe484358c40db7f233ed6b5605646 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'crypto/internal.h')
-rw-r--r-- | crypto/internal.h | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/crypto/internal.h b/crypto/internal.h index 964b9a60ca2..68612874b5f 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -16,7 +16,7 @@ #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/init.h> -#include <linux/kmod.h> +#include <linux/kernel.h> #include <asm/kmap_types.h> extern enum km_type crypto_km_types[]; @@ -42,20 +42,6 @@ static inline void crypto_yield(struct crypto_tfm *tfm) cond_resched(); } -static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) -{ - return (void *)&tfm[1]; -} - -struct crypto_alg *crypto_alg_lookup(const char *name); - -/* A far more intelligent version of this is planned. For now, just - * try an exact match on the name of the algorithm. */ -static inline struct crypto_alg *crypto_alg_mod_lookup(const char *name) -{ - return try_then_request_module(crypto_alg_lookup(name), name); -} - #ifdef CONFIG_CRYPTO_HMAC int crypto_alloc_hmac_block(struct crypto_tfm *tfm); void crypto_free_hmac_block(struct crypto_tfm *tfm); @@ -76,6 +62,33 @@ static inline void crypto_init_proc(void) { } #endif +static inline unsigned int crypto_digest_ctxsize(struct crypto_alg *alg, + int flags) +{ + return alg->cra_ctxsize; +} + +static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg, + int flags) +{ + unsigned int len = alg->cra_ctxsize; + + switch (flags & CRYPTO_TFM_MODE_MASK) { + case CRYPTO_TFM_MODE_CBC: + len = ALIGN(len, alg->cra_alignmask + 1); + len += alg->cra_blocksize; + break; + } + + return len; +} + +static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg, + int flags) +{ + return alg->cra_ctxsize; +} + int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags); int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags); int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags); |