diff options
author | Kevin Coffman <kwc@citi.umich.edu> | 2008-03-24 09:26:16 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-04-20 22:19:23 -0400 |
commit | 76cb9521795a167ae3d206343c072f602d84f815 (patch) | |
tree | 36aa2e201867c76ac244de69e1bb16befa0504ee /crypto/tcrypt.c | |
parent | fd4609a8e00a867303783ade62d67953fb72adc8 (diff) |
[CRYPTO] cts: Add CTS mode required for Kerberos AES support
Implement CTS wrapper for CBC mode required for support of AES
encryption support for Kerberos (rfc3962).
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r-- | crypto/tcrypt.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 30e75d49f35a..689482cd16c2 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -82,9 +82,8 @@ static char *check[] = { | |||
82 | "des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256", | 82 | "des", "md5", "des3_ede", "rot13", "sha1", "sha224", "sha256", |
83 | "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", | 83 | "blowfish", "twofish", "serpent", "sha384", "sha512", "md4", "aes", |
84 | "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", | 84 | "cast6", "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", |
85 | "arc4", "michael_mic", "deflate", "crc32c", "tea", "xtea", | ||
86 | "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", | 85 | "khazad", "wp512", "wp384", "wp256", "tnepres", "xeta", "fcrypt", |
87 | "camellia", "seed", "salsa20", "lzo", NULL | 86 | "camellia", "seed", "salsa20", "lzo", "cts", NULL |
88 | }; | 87 | }; |
89 | 88 | ||
90 | static void hexdump(unsigned char *buf, unsigned int len) | 89 | static void hexdump(unsigned char *buf, unsigned int len) |
@@ -1328,6 +1327,12 @@ static void do_test(void) | |||
1328 | test_cipher("ecb(seed)", DECRYPT, seed_dec_tv_template, | 1327 | test_cipher("ecb(seed)", DECRYPT, seed_dec_tv_template, |
1329 | SEED_DEC_TEST_VECTORS); | 1328 | SEED_DEC_TEST_VECTORS); |
1330 | 1329 | ||
1330 | //CTS | ||
1331 | test_cipher("cts(cbc(aes))", ENCRYPT, cts_mode_enc_tv_template, | ||
1332 | CTS_MODE_ENC_TEST_VECTORS); | ||
1333 | test_cipher("cts(cbc(aes))", DECRYPT, cts_mode_dec_tv_template, | ||
1334 | CTS_MODE_DEC_TEST_VECTORS); | ||
1335 | |||
1331 | test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS); | 1336 | test_hash("sha384", sha384_tv_template, SHA384_TEST_VECTORS); |
1332 | test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS); | 1337 | test_hash("sha512", sha512_tv_template, SHA512_TEST_VECTORS); |
1333 | test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS); | 1338 | test_hash("wp512", wp512_tv_template, WP512_TEST_VECTORS); |
@@ -1611,6 +1616,13 @@ static void do_test(void) | |||
1611 | AES_CCM_DEC_TEST_VECTORS); | 1616 | AES_CCM_DEC_TEST_VECTORS); |
1612 | break; | 1617 | break; |
1613 | 1618 | ||
1619 | case 38: | ||
1620 | test_cipher("cts(cbc(aes))", ENCRYPT, cts_mode_enc_tv_template, | ||
1621 | CTS_MODE_ENC_TEST_VECTORS); | ||
1622 | test_cipher("cts(cbc(aes))", DECRYPT, cts_mode_dec_tv_template, | ||
1623 | CTS_MODE_DEC_TEST_VECTORS); | ||
1624 | break; | ||
1625 | |||
1614 | case 100: | 1626 | case 100: |
1615 | test_hash("hmac(md5)", hmac_md5_tv_template, | 1627 | test_hash("hmac(md5)", hmac_md5_tv_template, |
1616 | HMAC_MD5_TEST_VECTORS); | 1628 | HMAC_MD5_TEST_VECTORS); |