diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 20:24:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-20 20:24:14 -0400 |
commit | 052497553e5dedc04c43800820c1d5788201cc71 (patch) | |
tree | 952466fc0f0df2b44b8df6b087c944ddf890f709 /crypto | |
parent | cae13fe4cc3f24820ffb990c09110626837e85d4 (diff) | |
parent | 4427b1b4ec111622071ec872c94594e05635c6e9 (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: (45 commits)
crypto: caam - add support for sha512 variants of existing AEAD algorithms
crypto: caam - remove unused authkeylen from caam_ctx
crypto: caam - fix decryption shared vs. non-shared key setting
crypto: caam - platform_bus_type migration
crypto: aesni-intel - fix aesni build on i386
crypto: aesni-intel - Merge with fpu.ko
crypto: mv_cesa - make count_sgs() null-pointer proof
crypto: mv_cesa - copy remaining bytes to SRAM only when needed
crypto: mv_cesa - move digest state initialisation to a better place
crypto: mv_cesa - fill inner/outer IV fields only in HMAC case
crypto: mv_cesa - refactor copy_src_to_buf()
crypto: mv_cesa - no need to save digest state after the last chunk
crypto: mv_cesa - print a warning when registration of AES algos fail
crypto: mv_cesa - drop this call to mv_hash_final from mv_hash_finup
crypto: mv_cesa - the descriptor pointer register needs to be set just once
crypto: mv_cesa - use ablkcipher_request_cast instead of the manual container_of
crypto: caam - fix printk recursion for long error texts
crypto: caam - remove unused keylen from session context
hwrng: amd - enable AMD hw rnd driver for Maple PPC boards
hwrng: amd - manage resource allocation
...
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Kconfig | 6 | ||||
-rw-r--r-- | crypto/tcrypt.c | 4 | ||||
-rw-r--r-- | crypto/testmgr.c | 16 | ||||
-rw-r--r-- | crypto/testmgr.h | 60 |
4 files changed, 80 insertions, 6 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index 4b7cb0e691cd..87b22ca9c223 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -264,11 +264,6 @@ config CRYPTO_XTS | |||
264 | key size 256, 384 or 512 bits. This implementation currently | 264 | key size 256, 384 or 512 bits. This implementation currently |
265 | can't handle a sectorsize which is not a multiple of 16 bytes. | 265 | can't handle a sectorsize which is not a multiple of 16 bytes. |
266 | 266 | ||
267 | config CRYPTO_FPU | ||
268 | tristate | ||
269 | select CRYPTO_BLKCIPHER | ||
270 | select CRYPTO_MANAGER | ||
271 | |||
272 | comment "Hash modes" | 267 | comment "Hash modes" |
273 | 268 | ||
274 | config CRYPTO_HMAC | 269 | config CRYPTO_HMAC |
@@ -543,7 +538,6 @@ config CRYPTO_AES_NI_INTEL | |||
543 | select CRYPTO_AES_586 if !64BIT | 538 | select CRYPTO_AES_586 if !64BIT |
544 | select CRYPTO_CRYPTD | 539 | select CRYPTO_CRYPTD |
545 | select CRYPTO_ALGAPI | 540 | select CRYPTO_ALGAPI |
546 | select CRYPTO_FPU | ||
547 | help | 541 | help |
548 | Use Intel AES-NI instructions for AES algorithm. | 542 | Use Intel AES-NI instructions for AES algorithm. |
549 | 543 | ||
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index e912ea5def3d..2222617b3bed 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -1009,6 +1009,10 @@ static int do_test(int m) | |||
1009 | speed_template_32_48_64); | 1009 | speed_template_32_48_64); |
1010 | test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, | 1010 | test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, |
1011 | speed_template_32_48_64); | 1011 | speed_template_32_48_64); |
1012 | test_cipher_speed("ctr(aes)", ENCRYPT, sec, NULL, 0, | ||
1013 | speed_template_16_24_32); | ||
1014 | test_cipher_speed("ctr(aes)", DECRYPT, sec, NULL, 0, | ||
1015 | speed_template_16_24_32); | ||
1012 | break; | 1016 | break; |
1013 | 1017 | ||
1014 | case 201: | 1018 | case 201: |
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 2854865f2434..b6b93d416351 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -2219,6 +2219,22 @@ static const struct alg_test_desc alg_test_descs[] = { | |||
2219 | } | 2219 | } |
2220 | } | 2220 | } |
2221 | }, { | 2221 | }, { |
2222 | .alg = "ofb(aes)", | ||
2223 | .test = alg_test_skcipher, | ||
2224 | .fips_allowed = 1, | ||
2225 | .suite = { | ||
2226 | .cipher = { | ||
2227 | .enc = { | ||
2228 | .vecs = aes_ofb_enc_tv_template, | ||
2229 | .count = AES_OFB_ENC_TEST_VECTORS | ||
2230 | }, | ||
2231 | .dec = { | ||
2232 | .vecs = aes_ofb_dec_tv_template, | ||
2233 | .count = AES_OFB_DEC_TEST_VECTORS | ||
2234 | } | ||
2235 | } | ||
2236 | } | ||
2237 | }, { | ||
2222 | .alg = "pcbc(fcrypt)", | 2238 | .alg = "pcbc(fcrypt)", |
2223 | .test = alg_test_skcipher, | 2239 | .test = alg_test_skcipher, |
2224 | .suite = { | 2240 | .suite = { |
diff --git a/crypto/testmgr.h b/crypto/testmgr.h index aa6dac05f843..27e60619538e 100644 --- a/crypto/testmgr.h +++ b/crypto/testmgr.h | |||
@@ -2980,6 +2980,8 @@ static struct cipher_testvec cast6_dec_tv_template[] = { | |||
2980 | #define AES_XTS_DEC_TEST_VECTORS 4 | 2980 | #define AES_XTS_DEC_TEST_VECTORS 4 |
2981 | #define AES_CTR_ENC_TEST_VECTORS 3 | 2981 | #define AES_CTR_ENC_TEST_VECTORS 3 |
2982 | #define AES_CTR_DEC_TEST_VECTORS 3 | 2982 | #define AES_CTR_DEC_TEST_VECTORS 3 |
2983 | #define AES_OFB_ENC_TEST_VECTORS 1 | ||
2984 | #define AES_OFB_DEC_TEST_VECTORS 1 | ||
2983 | #define AES_CTR_3686_ENC_TEST_VECTORS 7 | 2985 | #define AES_CTR_3686_ENC_TEST_VECTORS 7 |
2984 | #define AES_CTR_3686_DEC_TEST_VECTORS 6 | 2986 | #define AES_CTR_3686_DEC_TEST_VECTORS 6 |
2985 | #define AES_GCM_ENC_TEST_VECTORS 9 | 2987 | #define AES_GCM_ENC_TEST_VECTORS 9 |
@@ -5506,6 +5508,64 @@ static struct cipher_testvec aes_ctr_rfc3686_dec_tv_template[] = { | |||
5506 | }, | 5508 | }, |
5507 | }; | 5509 | }; |
5508 | 5510 | ||
5511 | static struct cipher_testvec aes_ofb_enc_tv_template[] = { | ||
5512 | /* From NIST Special Publication 800-38A, Appendix F.5 */ | ||
5513 | { | ||
5514 | .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6" | ||
5515 | "\xab\xf7\x15\x88\x09\xcf\x4f\x3c", | ||
5516 | .klen = 16, | ||
5517 | .iv = "\x00\x01\x02\x03\x04\x05\x06\x07\x08" | ||
5518 | "\x09\x0a\x0b\x0c\x0d\x0e\x0f", | ||
5519 | .input = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96" | ||
5520 | "\xe9\x3d\x7e\x11\x73\x93\x17\x2a" | ||
5521 | "\xae\x2d\x8a\x57\x1e\x03\xac\x9c" | ||
5522 | "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51" | ||
5523 | "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11" | ||
5524 | "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef" | ||
5525 | "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17" | ||
5526 | "\xad\x2b\x41\x7b\xe6\x6c\x37\x10", | ||
5527 | .ilen = 64, | ||
5528 | .result = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20" | ||
5529 | "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a" | ||
5530 | "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5" | ||
5531 | "\x3c\x52\xda\xc5\x4e\xd8\x25" | ||
5532 | "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43" | ||
5533 | "\x44\xf7\xa8\x22\x60\xed\xcc" | ||
5534 | "\x30\x4c\x65\x28\xf6\x59\xc7\x78" | ||
5535 | "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e", | ||
5536 | .rlen = 64, | ||
5537 | } | ||
5538 | }; | ||
5539 | |||
5540 | static struct cipher_testvec aes_ofb_dec_tv_template[] = { | ||
5541 | /* From NIST Special Publication 800-38A, Appendix F.5 */ | ||
5542 | { | ||
5543 | .key = "\x2b\x7e\x15\x16\x28\xae\xd2\xa6" | ||
5544 | "\xab\xf7\x15\x88\x09\xcf\x4f\x3c", | ||
5545 | .klen = 16, | ||
5546 | .iv = "\x00\x01\x02\x03\x04\x05\x06\x07\x08" | ||
5547 | "\x09\x0a\x0b\x0c\x0d\x0e\x0f", | ||
5548 | .input = "\x3b\x3f\xd9\x2e\xb7\x2d\xad\x20" | ||
5549 | "\x33\x34\x49\xf8\xe8\x3c\xfb\x4a" | ||
5550 | "\x77\x89\x50\x8d\x16\x91\x8f\x03\xf5" | ||
5551 | "\x3c\x52\xda\xc5\x4e\xd8\x25" | ||
5552 | "\x97\x40\x05\x1e\x9c\x5f\xec\xf6\x43" | ||
5553 | "\x44\xf7\xa8\x22\x60\xed\xcc" | ||
5554 | "\x30\x4c\x65\x28\xf6\x59\xc7\x78" | ||
5555 | "\x66\xa5\x10\xd9\xc1\xd6\xae\x5e", | ||
5556 | .ilen = 64, | ||
5557 | .result = "\x6b\xc1\xbe\xe2\x2e\x40\x9f\x96" | ||
5558 | "\xe9\x3d\x7e\x11\x73\x93\x17\x2a" | ||
5559 | "\xae\x2d\x8a\x57\x1e\x03\xac\x9c" | ||
5560 | "\x9e\xb7\x6f\xac\x45\xaf\x8e\x51" | ||
5561 | "\x30\xc8\x1c\x46\xa3\x5c\xe4\x11" | ||
5562 | "\xe5\xfb\xc1\x19\x1a\x0a\x52\xef" | ||
5563 | "\xf6\x9f\x24\x45\xdf\x4f\x9b\x17" | ||
5564 | "\xad\x2b\x41\x7b\xe6\x6c\x37\x10", | ||
5565 | .rlen = 64, | ||
5566 | } | ||
5567 | }; | ||
5568 | |||
5509 | static struct aead_testvec aes_gcm_enc_tv_template[] = { | 5569 | static struct aead_testvec aes_gcm_enc_tv_template[] = { |
5510 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ | 5570 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ |
5511 | .key = zeroed_string, | 5571 | .key = zeroed_string, |