diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 12:38:37 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 12:38:37 -0400 |
| commit | 332a3392188e0ad966543c87b8da2b9d246f301d (patch) | |
| tree | ac0d570590bffdd1924426adc5b255857d2f3297 /include/linux | |
| parent | a9c86d42599519f3d83b5f46bdab25046fe47b84 (diff) | |
| parent | 81bd5f6c966cf2f137c2759dfc78abdffcff055e (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (102 commits)
crypto: sha-s390 - Fix warnings in import function
crypto: vmac - New hash algorithm for intel_txt support
crypto: api - Do not displace newly registered algorithms
crypto: ansi_cprng - Fix module initialization
crypto: xcbc - Fix alignment calculation of xcbc_tfm_ctx
crypto: fips - Depend on ansi_cprng
crypto: blkcipher - Do not use eseqiv on stream ciphers
crypto: ctr - Use chainiv on raw counter mode
Revert crypto: fips - Select CPRNG
crypto: rng - Fix typo
crypto: talitos - add support for 36 bit addressing
crypto: talitos - align locks on cache lines
crypto: talitos - simplify hmac data size calculation
crypto: mv_cesa - Add support for Orion5X crypto engine
crypto: cryptd - Add support to access underlaying shash
crypto: gcm - Use GHASH digest algorithm
crypto: ghash - Add GHASH digest algorithm for GCM
crypto: authenc - Convert to ahash
crypto: api - Fix aligned ctx helper
crypto: hmac - Prehash ipad/opad
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/crypto.h | 43 | ||||
| -rw-r--r-- | include/linux/fips.h | 10 |
2 files changed, 12 insertions, 41 deletions
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index ec29fa268b94..fd929889e8dc 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
| @@ -115,7 +115,6 @@ struct crypto_async_request; | |||
| 115 | struct crypto_aead; | 115 | struct crypto_aead; |
| 116 | struct crypto_blkcipher; | 116 | struct crypto_blkcipher; |
| 117 | struct crypto_hash; | 117 | struct crypto_hash; |
| 118 | struct crypto_ahash; | ||
| 119 | struct crypto_rng; | 118 | struct crypto_rng; |
| 120 | struct crypto_tfm; | 119 | struct crypto_tfm; |
| 121 | struct crypto_type; | 120 | struct crypto_type; |
| @@ -146,16 +145,6 @@ struct ablkcipher_request { | |||
| 146 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | 145 | void *__ctx[] CRYPTO_MINALIGN_ATTR; |
| 147 | }; | 146 | }; |
| 148 | 147 | ||
| 149 | struct ahash_request { | ||
| 150 | struct crypto_async_request base; | ||
| 151 | |||
| 152 | unsigned int nbytes; | ||
| 153 | struct scatterlist *src; | ||
| 154 | u8 *result; | ||
| 155 | |||
| 156 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | ||
| 157 | }; | ||
| 158 | |||
| 159 | /** | 148 | /** |
| 160 | * struct aead_request - AEAD request | 149 | * struct aead_request - AEAD request |
| 161 | * @base: Common attributes for async crypto requests | 150 | * @base: Common attributes for async crypto requests |
| @@ -220,18 +209,6 @@ struct ablkcipher_alg { | |||
| 220 | unsigned int ivsize; | 209 | unsigned int ivsize; |
| 221 | }; | 210 | }; |
| 222 | 211 | ||
| 223 | struct ahash_alg { | ||
| 224 | int (*init)(struct ahash_request *req); | ||
| 225 | int (*reinit)(struct ahash_request *req); | ||
| 226 | int (*update)(struct ahash_request *req); | ||
| 227 | int (*final)(struct ahash_request *req); | ||
| 228 | int (*digest)(struct ahash_request *req); | ||
| 229 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 230 | unsigned int keylen); | ||
| 231 | |||
| 232 | unsigned int digestsize; | ||
| 233 | }; | ||
| 234 | |||
| 235 | struct aead_alg { | 212 | struct aead_alg { |
| 236 | int (*setkey)(struct crypto_aead *tfm, const u8 *key, | 213 | int (*setkey)(struct crypto_aead *tfm, const u8 *key, |
| 237 | unsigned int keylen); | 214 | unsigned int keylen); |
| @@ -318,7 +295,6 @@ struct rng_alg { | |||
| 318 | #define cra_cipher cra_u.cipher | 295 | #define cra_cipher cra_u.cipher |
| 319 | #define cra_digest cra_u.digest | 296 | #define cra_digest cra_u.digest |
| 320 | #define cra_hash cra_u.hash | 297 | #define cra_hash cra_u.hash |
| 321 | #define cra_ahash cra_u.ahash | ||
| 322 | #define cra_compress cra_u.compress | 298 | #define cra_compress cra_u.compress |
| 323 | #define cra_rng cra_u.rng | 299 | #define cra_rng cra_u.rng |
| 324 | 300 | ||
| @@ -346,7 +322,6 @@ struct crypto_alg { | |||
| 346 | struct cipher_alg cipher; | 322 | struct cipher_alg cipher; |
| 347 | struct digest_alg digest; | 323 | struct digest_alg digest; |
| 348 | struct hash_alg hash; | 324 | struct hash_alg hash; |
| 349 | struct ahash_alg ahash; | ||
| 350 | struct compress_alg compress; | 325 | struct compress_alg compress; |
| 351 | struct rng_alg rng; | 326 | struct rng_alg rng; |
| 352 | } cra_u; | 327 | } cra_u; |
| @@ -433,18 +408,6 @@ struct hash_tfm { | |||
| 433 | unsigned int digestsize; | 408 | unsigned int digestsize; |
| 434 | }; | 409 | }; |
| 435 | 410 | ||
| 436 | struct ahash_tfm { | ||
| 437 | int (*init)(struct ahash_request *req); | ||
| 438 | int (*update)(struct ahash_request *req); | ||
| 439 | int (*final)(struct ahash_request *req); | ||
| 440 | int (*digest)(struct ahash_request *req); | ||
| 441 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 442 | unsigned int keylen); | ||
| 443 | |||
| 444 | unsigned int digestsize; | ||
| 445 | unsigned int reqsize; | ||
| 446 | }; | ||
| 447 | |||
| 448 | struct compress_tfm { | 411 | struct compress_tfm { |
| 449 | int (*cot_compress)(struct crypto_tfm *tfm, | 412 | int (*cot_compress)(struct crypto_tfm *tfm, |
| 450 | const u8 *src, unsigned int slen, | 413 | const u8 *src, unsigned int slen, |
| @@ -465,7 +428,6 @@ struct rng_tfm { | |||
| 465 | #define crt_blkcipher crt_u.blkcipher | 428 | #define crt_blkcipher crt_u.blkcipher |
| 466 | #define crt_cipher crt_u.cipher | 429 | #define crt_cipher crt_u.cipher |
| 467 | #define crt_hash crt_u.hash | 430 | #define crt_hash crt_u.hash |
| 468 | #define crt_ahash crt_u.ahash | ||
| 469 | #define crt_compress crt_u.compress | 431 | #define crt_compress crt_u.compress |
| 470 | #define crt_rng crt_u.rng | 432 | #define crt_rng crt_u.rng |
| 471 | 433 | ||
| @@ -479,7 +441,6 @@ struct crypto_tfm { | |||
| 479 | struct blkcipher_tfm blkcipher; | 441 | struct blkcipher_tfm blkcipher; |
| 480 | struct cipher_tfm cipher; | 442 | struct cipher_tfm cipher; |
| 481 | struct hash_tfm hash; | 443 | struct hash_tfm hash; |
| 482 | struct ahash_tfm ahash; | ||
| 483 | struct compress_tfm compress; | 444 | struct compress_tfm compress; |
| 484 | struct rng_tfm rng; | 445 | struct rng_tfm rng; |
| 485 | } crt_u; | 446 | } crt_u; |
| @@ -770,7 +731,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc( | |||
| 770 | 731 | ||
| 771 | static inline void ablkcipher_request_free(struct ablkcipher_request *req) | 732 | static inline void ablkcipher_request_free(struct ablkcipher_request *req) |
| 772 | { | 733 | { |
| 773 | kfree(req); | 734 | kzfree(req); |
| 774 | } | 735 | } |
| 775 | 736 | ||
| 776 | static inline void ablkcipher_request_set_callback( | 737 | static inline void ablkcipher_request_set_callback( |
| @@ -901,7 +862,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, | |||
| 901 | 862 | ||
| 902 | static inline void aead_request_free(struct aead_request *req) | 863 | static inline void aead_request_free(struct aead_request *req) |
| 903 | { | 864 | { |
| 904 | kfree(req); | 865 | kzfree(req); |
| 905 | } | 866 | } |
| 906 | 867 | ||
| 907 | static inline void aead_request_set_callback(struct aead_request *req, | 868 | static inline void aead_request_set_callback(struct aead_request *req, |
diff --git a/include/linux/fips.h b/include/linux/fips.h new file mode 100644 index 000000000000..f8fb07b0b6b8 --- /dev/null +++ b/include/linux/fips.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _FIPS_H | ||
| 2 | #define _FIPS_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_CRYPTO_FIPS | ||
| 5 | extern int fips_enabled; | ||
| 6 | #else | ||
| 7 | #define fips_enabled 0 | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif | ||
