aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/tcrypt.c
diff options
context:
space:
mode:
authorSebastian Siewior <sebastian@breakpoint.cc>2008-03-11 09:24:26 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2008-04-20 22:19:21 -0400
commit477035c2abdcff7583369e5777cb7be1bb1dbea8 (patch)
tree797db8233c052ae8128e28c304d15fa8e25c1b68 /crypto/tcrypt.c
parent78f8b3a24022c48fe600f4aba415d63ceeaec9cd (diff)
[CRYPTO] tcrypt: Group common speed templates
Some crypto ciphers which are impleneted support similar key sizes (16,24 & 32 byte). They can be grouped together and use a common templatte instead of their own which contains the same data. Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/tcrypt.c')
-rw-r--r--crypto/tcrypt.c70
1 files changed, 33 insertions, 37 deletions
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c
index 1ab8c017a011..cff18364fbc1 100644
--- a/crypto/tcrypt.c
+++ b/crypto/tcrypt.c
@@ -1621,89 +1621,85 @@ static void do_test(void)
1621 1621
1622 case 200: 1622 case 200:
1623 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, 1623 test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0,
1624 aes_speed_template); 1624 speed_template_16_24_32);
1625 test_cipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0, 1625 test_cipher_speed("ecb(aes)", DECRYPT, sec, NULL, 0,
1626 aes_speed_template); 1626 speed_template_16_24_32);
1627 test_cipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0, 1627 test_cipher_speed("cbc(aes)", ENCRYPT, sec, NULL, 0,
1628 aes_speed_template); 1628 speed_template_16_24_32);
1629 test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0, 1629 test_cipher_speed("cbc(aes)", DECRYPT, sec, NULL, 0,
1630 aes_speed_template); 1630 speed_template_16_24_32);
1631 test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0, 1631 test_cipher_speed("lrw(aes)", ENCRYPT, sec, NULL, 0,
1632 aes_lrw_speed_template); 1632 speed_template_32_40_48);
1633 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, 1633 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0,
1634 aes_lrw_speed_template); 1634 speed_template_32_40_48);
1635 test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, 1635 test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0,
1636 aes_xts_speed_template); 1636 speed_template_32_48_64);
1637 test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0, 1637 test_cipher_speed("xts(aes)", DECRYPT, sec, NULL, 0,
1638 aes_xts_speed_template); 1638 speed_template_32_48_64);
1639 break; 1639 break;
1640 1640
1641 case 201: 1641 case 201:
1642 test_cipher_speed("ecb(des3_ede)", ENCRYPT, sec, 1642 test_cipher_speed("ecb(des3_ede)", ENCRYPT, sec,
1643 des3_ede_enc_tv_template, 1643 des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS,
1644 DES3_EDE_ENC_TEST_VECTORS, 1644 speed_template_24);
1645 des3_ede_speed_template);
1646 test_cipher_speed("ecb(des3_ede)", DECRYPT, sec, 1645 test_cipher_speed("ecb(des3_ede)", DECRYPT, sec,
1647 des3_ede_dec_tv_template, 1646 des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS,
1648 DES3_EDE_DEC_TEST_VECTORS, 1647 speed_template_24);
1649 des3_ede_speed_template);
1650 test_cipher_speed("cbc(des3_ede)", ENCRYPT, sec, 1648 test_cipher_speed("cbc(des3_ede)", ENCRYPT, sec,
1651 des3_ede_enc_tv_template, 1649 des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS,
1652 DES3_EDE_ENC_TEST_VECTORS, 1650 speed_template_24);
1653 des3_ede_speed_template);
1654 test_cipher_speed("cbc(des3_ede)", DECRYPT, sec, 1651 test_cipher_speed("cbc(des3_ede)", DECRYPT, sec,
1655 des3_ede_dec_tv_template, 1652 des3_ede_enc_tv_template, DES3_EDE_ENC_TEST_VECTORS,
1656 DES3_EDE_DEC_TEST_VECTORS, 1653 speed_template_24);
1657 des3_ede_speed_template);
1658 break; 1654 break;
1659 1655
1660 case 202: 1656 case 202:
1661 test_cipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0, 1657 test_cipher_speed("ecb(twofish)", ENCRYPT, sec, NULL, 0,
1662 twofish_speed_template); 1658 speed_template_16_24_32);
1663 test_cipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0, 1659 test_cipher_speed("ecb(twofish)", DECRYPT, sec, NULL, 0,
1664 twofish_speed_template); 1660 speed_template_16_24_32);
1665 test_cipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0, 1661 test_cipher_speed("cbc(twofish)", ENCRYPT, sec, NULL, 0,
1666 twofish_speed_template); 1662 speed_template_16_24_32);
1667 test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0, 1663 test_cipher_speed("cbc(twofish)", DECRYPT, sec, NULL, 0,
1668 twofish_speed_template); 1664 speed_template_16_24_32);
1669 break; 1665 break;
1670 1666
1671 case 203: 1667 case 203:
1672 test_cipher_speed("ecb(blowfish)", ENCRYPT, sec, NULL, 0, 1668 test_cipher_speed("ecb(blowfish)", ENCRYPT, sec, NULL, 0,
1673 blowfish_speed_template); 1669 speed_template_8_32);
1674 test_cipher_speed("ecb(blowfish)", DECRYPT, sec, NULL, 0, 1670 test_cipher_speed("ecb(blowfish)", DECRYPT, sec, NULL, 0,
1675 blowfish_speed_template); 1671 speed_template_8_32);
1676 test_cipher_speed("cbc(blowfish)", ENCRYPT, sec, NULL, 0, 1672 test_cipher_speed("cbc(blowfish)", ENCRYPT, sec, NULL, 0,
1677 blowfish_speed_template); 1673 speed_template_8_32);
1678 test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0, 1674 test_cipher_speed("cbc(blowfish)", DECRYPT, sec, NULL, 0,
1679 blowfish_speed_template); 1675 speed_template_8_32);
1680 break; 1676 break;
1681 1677
1682 case 204: 1678 case 204:
1683 test_cipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0, 1679 test_cipher_speed("ecb(des)", ENCRYPT, sec, NULL, 0,
1684 des_speed_template); 1680 speed_template_8);
1685 test_cipher_speed("ecb(des)", DECRYPT, sec, NULL, 0, 1681 test_cipher_speed("ecb(des)", DECRYPT, sec, NULL, 0,
1686 des_speed_template); 1682 speed_template_8);
1687 test_cipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0, 1683 test_cipher_speed("cbc(des)", ENCRYPT, sec, NULL, 0,
1688 des_speed_template); 1684 speed_template_8);
1689 test_cipher_speed("cbc(des)", DECRYPT, sec, NULL, 0, 1685 test_cipher_speed("cbc(des)", DECRYPT, sec, NULL, 0,
1690 des_speed_template); 1686 speed_template_8);
1691 break; 1687 break;
1692 1688
1693 case 205: 1689 case 205:
1694 test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0, 1690 test_cipher_speed("ecb(camellia)", ENCRYPT, sec, NULL, 0,
1695 camellia_speed_template); 1691 speed_template_16_24_32);
1696 test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0, 1692 test_cipher_speed("ecb(camellia)", DECRYPT, sec, NULL, 0,
1697 camellia_speed_template); 1693 speed_template_16_24_32);
1698 test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0, 1694 test_cipher_speed("cbc(camellia)", ENCRYPT, sec, NULL, 0,
1699 camellia_speed_template); 1695 speed_template_16_24_32);
1700 test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0, 1696 test_cipher_speed("cbc(camellia)", DECRYPT, sec, NULL, 0,
1701 camellia_speed_template); 1697 speed_template_16_24_32);
1702 break; 1698 break;
1703 1699
1704 case 206: 1700 case 206:
1705 test_cipher_speed("salsa20", ENCRYPT, sec, NULL, 0, 1701 test_cipher_speed("salsa20", ENCRYPT, sec, NULL, 0,
1706 salsa20_speed_template); 1702 speed_template_16_32);
1707 break; 1703 break;
1708 1704
1709 case 300: 1705 case 300: