diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 14:03:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 14:03:29 -0400 |
commit | 972d19e837833b93466c6f6a8ef2a7d653000aa3 (patch) | |
tree | 069258492d5347cf440b8240dadfa20621f54842 /include | |
parent | cdf4f383a4b0ffbf458f65380ecffbeee1f79841 (diff) | |
parent | b9d0a25a484a90c1d60b974d115eff2fe580ce16 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6:
[CRYPTO] tcrypt: Forbid tcrypt from being built-in
[CRYPTO] aes: Add wrappers for assembly routines
[CRYPTO] tcrypt: Speed benchmark support for digest algorithms
[CRYPTO] tcrypt: Return -EAGAIN from module_init()
[CRYPTO] api: Allow replacement when registering new algorithms
[CRYPTO] api: Removed const from cra_name/cra_driver_name
[CRYPTO] api: Added cra_init/cra_exit
[CRYPTO] api: Fixed incorrect passing of context instead of tfm
[CRYPTO] padlock: Rearrange context structure to reduce code size
[CRYPTO] all: Pass tfm instead of ctx to algorithms
[CRYPTO] digest: Remove unnecessary zeroing during init
[CRYPTO] aes-i586: Get rid of useless function wrappers
[CRYPTO] digest: Add alignment handling
[CRYPTO] khazad: Use 32-bit reads on key
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/crypto.h | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 5a0470e36111..7f946241b879 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -66,7 +66,7 @@ struct crypto_tfm; | |||
66 | 66 | ||
67 | struct cipher_desc { | 67 | struct cipher_desc { |
68 | struct crypto_tfm *tfm; | 68 | struct crypto_tfm *tfm; |
69 | void (*crfn)(void *ctx, u8 *dst, const u8 *src); | 69 | void (*crfn)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
70 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, | 70 | unsigned int (*prfn)(const struct cipher_desc *desc, u8 *dst, |
71 | const u8 *src, unsigned int nbytes); | 71 | const u8 *src, unsigned int nbytes); |
72 | void *info; | 72 | void *info; |
@@ -79,10 +79,10 @@ struct cipher_desc { | |||
79 | struct cipher_alg { | 79 | struct cipher_alg { |
80 | unsigned int cia_min_keysize; | 80 | unsigned int cia_min_keysize; |
81 | unsigned int cia_max_keysize; | 81 | unsigned int cia_max_keysize; |
82 | int (*cia_setkey)(void *ctx, const u8 *key, | 82 | int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, |
83 | unsigned int keylen, u32 *flags); | 83 | unsigned int keylen, u32 *flags); |
84 | void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); | 84 | void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
85 | void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); | 85 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
86 | 86 | ||
87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, | 87 | unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, |
88 | u8 *dst, const u8 *src, | 88 | u8 *dst, const u8 *src, |
@@ -100,20 +100,19 @@ struct cipher_alg { | |||
100 | 100 | ||
101 | struct digest_alg { | 101 | struct digest_alg { |
102 | unsigned int dia_digestsize; | 102 | unsigned int dia_digestsize; |
103 | void (*dia_init)(void *ctx); | 103 | void (*dia_init)(struct crypto_tfm *tfm); |
104 | void (*dia_update)(void *ctx, const u8 *data, unsigned int len); | 104 | void (*dia_update)(struct crypto_tfm *tfm, const u8 *data, |
105 | void (*dia_final)(void *ctx, u8 *out); | 105 | unsigned int len); |
106 | int (*dia_setkey)(void *ctx, const u8 *key, | 106 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); |
107 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
107 | unsigned int keylen, u32 *flags); | 108 | unsigned int keylen, u32 *flags); |
108 | }; | 109 | }; |
109 | 110 | ||
110 | struct compress_alg { | 111 | struct compress_alg { |
111 | int (*coa_init)(void *ctx); | 112 | int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, |
112 | void (*coa_exit)(void *ctx); | 113 | unsigned int slen, u8 *dst, unsigned int *dlen); |
113 | int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, | 114 | int (*coa_decompress)(struct crypto_tfm *tfm, const u8 *src, |
114 | u8 *dst, unsigned int *dlen); | 115 | unsigned int slen, u8 *dst, unsigned int *dlen); |
115 | int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, | ||
116 | u8 *dst, unsigned int *dlen); | ||
117 | }; | 116 | }; |
118 | 117 | ||
119 | #define cra_cipher cra_u.cipher | 118 | #define cra_cipher cra_u.cipher |
@@ -129,14 +128,17 @@ struct crypto_alg { | |||
129 | 128 | ||
130 | int cra_priority; | 129 | int cra_priority; |
131 | 130 | ||
132 | const char cra_name[CRYPTO_MAX_ALG_NAME]; | 131 | char cra_name[CRYPTO_MAX_ALG_NAME]; |
133 | const char cra_driver_name[CRYPTO_MAX_ALG_NAME]; | 132 | char cra_driver_name[CRYPTO_MAX_ALG_NAME]; |
134 | 133 | ||
135 | union { | 134 | union { |
136 | struct cipher_alg cipher; | 135 | struct cipher_alg cipher; |
137 | struct digest_alg digest; | 136 | struct digest_alg digest; |
138 | struct compress_alg compress; | 137 | struct compress_alg compress; |
139 | } cra_u; | 138 | } cra_u; |
139 | |||
140 | int (*cra_init)(struct crypto_tfm *tfm); | ||
141 | void (*cra_exit)(struct crypto_tfm *tfm); | ||
140 | 142 | ||
141 | struct module *cra_module; | 143 | struct module *cra_module; |
142 | }; | 144 | }; |