diff options
Diffstat (limited to 'crypto/internal.h')
-rw-r--r-- | crypto/internal.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/internal.h b/crypto/internal.h index 83b1b6d6d92b..68612874b5fd 100644 --- a/crypto/internal.h +++ b/crypto/internal.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/highmem.h> | 16 | #include <linux/highmem.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/kernel.h> | ||
19 | #include <asm/kmap_types.h> | 20 | #include <asm/kmap_types.h> |
20 | 21 | ||
21 | extern enum km_type crypto_km_types[]; | 22 | extern enum km_type crypto_km_types[]; |
@@ -61,6 +62,33 @@ static inline void crypto_init_proc(void) | |||
61 | { } | 62 | { } |
62 | #endif | 63 | #endif |
63 | 64 | ||
65 | static inline unsigned int crypto_digest_ctxsize(struct crypto_alg *alg, | ||
66 | int flags) | ||
67 | { | ||
68 | return alg->cra_ctxsize; | ||
69 | } | ||
70 | |||
71 | static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg, | ||
72 | int flags) | ||
73 | { | ||
74 | unsigned int len = alg->cra_ctxsize; | ||
75 | |||
76 | switch (flags & CRYPTO_TFM_MODE_MASK) { | ||
77 | case CRYPTO_TFM_MODE_CBC: | ||
78 | len = ALIGN(len, alg->cra_alignmask + 1); | ||
79 | len += alg->cra_blocksize; | ||
80 | break; | ||
81 | } | ||
82 | |||
83 | return len; | ||
84 | } | ||
85 | |||
86 | static inline unsigned int crypto_compress_ctxsize(struct crypto_alg *alg, | ||
87 | int flags) | ||
88 | { | ||
89 | return alg->cra_ctxsize; | ||
90 | } | ||
91 | |||
64 | int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags); | 92 | int crypto_init_digest_flags(struct crypto_tfm *tfm, u32 flags); |
65 | int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags); | 93 | int crypto_init_cipher_flags(struct crypto_tfm *tfm, u32 flags); |
66 | int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags); | 94 | int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags); |