diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-06 15:59:59 -0500 |
commit | ccf18968b1bbc2fb117190a1984ac2a826dac228 (patch) | |
tree | 7bc8fbf5722aecf1e84fa50c31c657864cba1daa /crypto | |
parent | e91c021c487110386a07facd0396e6c3b7cf9c1f (diff) | |
parent | d99cf9d679a520d67f81d805b7cb91c68e1847f0 (diff) |
Merge ../torvalds-2.6/
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Kconfig | 43 | ||||
-rw-r--r-- | crypto/tcrypt.c | 4 | ||||
-rw-r--r-- | crypto/tcrypt.h | 64 |
3 files changed, 105 insertions, 6 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index 89299f4ffe12..52e1d4108a99 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -40,10 +40,11 @@ config CRYPTO_SHA1 | |||
40 | help | 40 | help |
41 | SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). | 41 | SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). |
42 | 42 | ||
43 | config CRYPTO_SHA1_Z990 | 43 | config CRYPTO_SHA1_S390 |
44 | tristate "SHA1 digest algorithm for IBM zSeries z990" | 44 | tristate "SHA1 digest algorithm (s390)" |
45 | depends on CRYPTO && ARCH_S390 | 45 | depends on CRYPTO && S390 |
46 | help | 46 | help |
47 | This is the s390 hardware accelerated implementation of the | ||
47 | SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). | 48 | SHA-1 secure hash standard (FIPS 180-1/DFIPS 180-2). |
48 | 49 | ||
49 | config CRYPTO_SHA256 | 50 | config CRYPTO_SHA256 |
@@ -55,6 +56,16 @@ config CRYPTO_SHA256 | |||
55 | This version of SHA implements a 256 bit hash with 128 bits of | 56 | This version of SHA implements a 256 bit hash with 128 bits of |
56 | security against collision attacks. | 57 | security against collision attacks. |
57 | 58 | ||
59 | config CRYPTO_SHA256_S390 | ||
60 | tristate "SHA256 digest algorithm (s390)" | ||
61 | depends on CRYPTO && S390 | ||
62 | help | ||
63 | This is the s390 hardware accelerated implementation of the | ||
64 | SHA256 secure hash standard (DFIPS 180-2). | ||
65 | |||
66 | This version of SHA implements a 256 bit hash with 128 bits of | ||
67 | security against collision attacks. | ||
68 | |||
58 | config CRYPTO_SHA512 | 69 | config CRYPTO_SHA512 |
59 | tristate "SHA384 and SHA512 digest algorithms" | 70 | tristate "SHA384 and SHA512 digest algorithms" |
60 | depends on CRYPTO | 71 | depends on CRYPTO |
@@ -98,9 +109,9 @@ config CRYPTO_DES | |||
98 | help | 109 | help |
99 | DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). | 110 | DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). |
100 | 111 | ||
101 | config CRYPTO_DES_Z990 | 112 | config CRYPTO_DES_S390 |
102 | tristate "DES and Triple DES cipher algorithms for IBM zSeries z990" | 113 | tristate "DES and Triple DES cipher algorithms (s390)" |
103 | depends on CRYPTO && ARCH_S390 | 114 | depends on CRYPTO && S390 |
104 | help | 115 | help |
105 | DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). | 116 | DES cipher algorithm (FIPS 46-2), and Triple DES EDE (FIPS 46-3). |
106 | 117 | ||
@@ -204,6 +215,26 @@ config CRYPTO_AES_X86_64 | |||
204 | 215 | ||
205 | See <http://csrc.nist.gov/encryption/aes/> for more information. | 216 | See <http://csrc.nist.gov/encryption/aes/> for more information. |
206 | 217 | ||
218 | config CRYPTO_AES_S390 | ||
219 | tristate "AES cipher algorithms (s390)" | ||
220 | depends on CRYPTO && S390 | ||
221 | help | ||
222 | This is the s390 hardware accelerated implementation of the | ||
223 | AES cipher algorithms (FIPS-197). AES uses the Rijndael | ||
224 | algorithm. | ||
225 | |||
226 | Rijndael appears to be consistently a very good performer in | ||
227 | both hardware and software across a wide range of computing | ||
228 | environments regardless of its use in feedback or non-feedback | ||
229 | modes. Its key setup time is excellent, and its key agility is | ||
230 | good. Rijndael's very low memory requirements make it very well | ||
231 | suited for restricted-space environments, in which it also | ||
232 | demonstrates excellent performance. Rijndael's operations are | ||
233 | among the easiest to defend against power and timing attacks. | ||
234 | |||
235 | On s390 the System z9-109 currently only supports the key size | ||
236 | of 128 bit. | ||
237 | |||
207 | config CRYPTO_CAST5 | 238 | config CRYPTO_CAST5 |
208 | tristate "CAST5 (CAST-128) cipher algorithm" | 239 | tristate "CAST5 (CAST-128) cipher algorithm" |
209 | depends on CRYPTO | 240 | depends on CRYPTO |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 53f4ee804bdb..49e344f00806 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -805,6 +805,8 @@ static void do_test(void) | |||
805 | //AES | 805 | //AES |
806 | test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS); | 806 | test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS); |
807 | test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS); | 807 | test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS); |
808 | test_cipher ("aes", MODE_CBC, ENCRYPT, aes_cbc_enc_tv_template, AES_CBC_ENC_TEST_VECTORS); | ||
809 | test_cipher ("aes", MODE_CBC, DECRYPT, aes_cbc_dec_tv_template, AES_CBC_DEC_TEST_VECTORS); | ||
808 | 810 | ||
809 | //CAST5 | 811 | //CAST5 |
810 | test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS); | 812 | test_cipher ("cast5", MODE_ECB, ENCRYPT, cast5_enc_tv_template, CAST5_ENC_TEST_VECTORS); |
@@ -910,6 +912,8 @@ static void do_test(void) | |||
910 | case 10: | 912 | case 10: |
911 | test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS); | 913 | test_cipher ("aes", MODE_ECB, ENCRYPT, aes_enc_tv_template, AES_ENC_TEST_VECTORS); |
912 | test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS); | 914 | test_cipher ("aes", MODE_ECB, DECRYPT, aes_dec_tv_template, AES_DEC_TEST_VECTORS); |
915 | test_cipher ("aes", MODE_CBC, ENCRYPT, aes_cbc_enc_tv_template, AES_CBC_ENC_TEST_VECTORS); | ||
916 | test_cipher ("aes", MODE_CBC, DECRYPT, aes_cbc_dec_tv_template, AES_CBC_DEC_TEST_VECTORS); | ||
913 | break; | 917 | break; |
914 | 918 | ||
915 | case 11: | 919 | case 11: |
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index 522ffd4b6f43..733d07ed75e9 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h | |||
@@ -1836,6 +1836,8 @@ static struct cipher_testvec cast6_dec_tv_template[] = { | |||
1836 | */ | 1836 | */ |
1837 | #define AES_ENC_TEST_VECTORS 3 | 1837 | #define AES_ENC_TEST_VECTORS 3 |
1838 | #define AES_DEC_TEST_VECTORS 3 | 1838 | #define AES_DEC_TEST_VECTORS 3 |
1839 | #define AES_CBC_ENC_TEST_VECTORS 2 | ||
1840 | #define AES_CBC_DEC_TEST_VECTORS 2 | ||
1839 | 1841 | ||
1840 | static struct cipher_testvec aes_enc_tv_template[] = { | 1842 | static struct cipher_testvec aes_enc_tv_template[] = { |
1841 | { /* From FIPS-197 */ | 1843 | { /* From FIPS-197 */ |
@@ -1911,6 +1913,68 @@ static struct cipher_testvec aes_dec_tv_template[] = { | |||
1911 | }, | 1913 | }, |
1912 | }; | 1914 | }; |
1913 | 1915 | ||
1916 | static struct cipher_testvec aes_cbc_enc_tv_template[] = { | ||
1917 | { /* From RFC 3602 */ | ||
1918 | .key = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b, | ||
1919 | 0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 }, | ||
1920 | .klen = 16, | ||
1921 | .iv = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30, | ||
1922 | 0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 }, | ||
1923 | .input = { "Single block msg" }, | ||
1924 | .ilen = 16, | ||
1925 | .result = { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8, | ||
1926 | 0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a }, | ||
1927 | .rlen = 16, | ||
1928 | }, { | ||
1929 | .key = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0, | ||
1930 | 0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a }, | ||
1931 | .klen = 16, | ||
1932 | .iv = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28, | ||
1933 | 0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }, | ||
1934 | .input = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
1935 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | ||
1936 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
1937 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, | ||
1938 | .ilen = 32, | ||
1939 | .result = { 0xd2, 0x96, 0xcd, 0x94, 0xc2, 0xcc, 0xcf, 0x8a, | ||
1940 | 0x3a, 0x86, 0x30, 0x28, 0xb5, 0xe1, 0xdc, 0x0a, | ||
1941 | 0x75, 0x86, 0x60, 0x2d, 0x25, 0x3c, 0xff, 0xf9, | ||
1942 | 0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 }, | ||
1943 | .rlen = 32, | ||
1944 | }, | ||
1945 | }; | ||
1946 | |||
1947 | static struct cipher_testvec aes_cbc_dec_tv_template[] = { | ||
1948 | { /* From RFC 3602 */ | ||
1949 | .key = { 0x06, 0xa9, 0x21, 0x40, 0x36, 0xb8, 0xa1, 0x5b, | ||
1950 | 0x51, 0x2e, 0x03, 0xd5, 0x34, 0x12, 0x00, 0x06 }, | ||
1951 | .klen = 16, | ||
1952 | .iv = { 0x3d, 0xaf, 0xba, 0x42, 0x9d, 0x9e, 0xb4, 0x30, | ||
1953 | 0xb4, 0x22, 0xda, 0x80, 0x2c, 0x9f, 0xac, 0x41 }, | ||
1954 | .input = { 0xe3, 0x53, 0x77, 0x9c, 0x10, 0x79, 0xae, 0xb8, | ||
1955 | 0x27, 0x08, 0x94, 0x2d, 0xbe, 0x77, 0x18, 0x1a }, | ||
1956 | .ilen = 16, | ||
1957 | .result = { "Single block msg" }, | ||
1958 | .rlen = 16, | ||
1959 | }, { | ||
1960 | .key = { 0xc2, 0x86, 0x69, 0x6d, 0x88, 0x7c, 0x9a, 0xa0, | ||
1961 | 0x61, 0x1b, 0xbb, 0x3e, 0x20, 0x25, 0xa4, 0x5a }, | ||
1962 | .klen = 16, | ||
1963 | .iv = { 0x56, 0x2e, 0x17, 0x99, 0x6d, 0x09, 0x3d, 0x28, | ||
1964 | 0xdd, 0xb3, 0xba, 0x69, 0x5a, 0x2e, 0x6f, 0x58 }, | ||
1965 | .input = { 0xd2, 0x96, 0xcd, 0x94, 0xc2, 0xcc, 0xcf, 0x8a, | ||
1966 | 0x3a, 0x86, 0x30, 0x28, 0xb5, 0xe1, 0xdc, 0x0a, | ||
1967 | 0x75, 0x86, 0x60, 0x2d, 0x25, 0x3c, 0xff, 0xf9, | ||
1968 | 0x1b, 0x82, 0x66, 0xbe, 0xa6, 0xd6, 0x1a, 0xb1 }, | ||
1969 | .ilen = 32, | ||
1970 | .result = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, | ||
1971 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, | ||
1972 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, | ||
1973 | 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f }, | ||
1974 | .rlen = 32, | ||
1975 | }, | ||
1976 | }; | ||
1977 | |||
1914 | /* Cast5 test vectors from RFC 2144 */ | 1978 | /* Cast5 test vectors from RFC 2144 */ |
1915 | #define CAST5_ENC_TEST_VECTORS 3 | 1979 | #define CAST5_ENC_TEST_VECTORS 3 |
1916 | #define CAST5_DEC_TEST_VECTORS 3 | 1980 | #define CAST5_DEC_TEST_VECTORS 3 |