aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/talitos.c
diff options
context:
space:
mode:
authorLee Nipper <lee.nipper@gmail.com>2010-05-19 05:18:38 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2010-05-19 05:18:38 -0400
commitd5e4aaefd99797929e4455db48d8f9a8728f05f4 (patch)
treec187f2bc2148dd272255257d56eee9176c306e28 /drivers/crypto/talitos.c
parent0a625fd2abaa0aa0a6852b153d429dbc784748cc (diff)
crypto: talitos - prepare for adding ahash algorithms
No functional changes. Use a union in talitos_alg_template for the crypto_alg so that we can add a member later for ahash_alg. Signed-off-by: Lee Nipper <lee.nipper@gmail.com> Acked-By: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/talitos.c')
-rw-r--r--drivers/crypto/talitos.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index dc558a097311..ce38b05c8def 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1479,14 +1479,17 @@ static int ablkcipher_decrypt(struct ablkcipher_request *areq)
1479} 1479}
1480 1480
1481struct talitos_alg_template { 1481struct talitos_alg_template {
1482 struct crypto_alg alg; 1482 u32 type;
1483 union {
1484 struct crypto_alg crypto;
1485 } alg;
1483 __be32 desc_hdr_template; 1486 __be32 desc_hdr_template;
1484}; 1487};
1485 1488
1486static struct talitos_alg_template driver_algs[] = { 1489static struct talitos_alg_template driver_algs[] = {
1487 /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */ 1490 /* AEAD algorithms. These use a single-pass ipsec_esp descriptor */
1488 { 1491 { .type = CRYPTO_ALG_TYPE_AEAD,
1489 .alg = { 1492 .alg.crypto = {
1490 .cra_name = "authenc(hmac(sha1),cbc(aes))", 1493 .cra_name = "authenc(hmac(sha1),cbc(aes))",
1491 .cra_driver_name = "authenc-hmac-sha1-cbc-aes-talitos", 1494 .cra_driver_name = "authenc-hmac-sha1-cbc-aes-talitos",
1492 .cra_blocksize = AES_BLOCK_SIZE, 1495 .cra_blocksize = AES_BLOCK_SIZE,
@@ -1511,8 +1514,8 @@ static struct talitos_alg_template driver_algs[] = {
1511 DESC_HDR_MODE1_MDEU_PAD | 1514 DESC_HDR_MODE1_MDEU_PAD |
1512 DESC_HDR_MODE1_MDEU_SHA1_HMAC, 1515 DESC_HDR_MODE1_MDEU_SHA1_HMAC,
1513 }, 1516 },
1514 { 1517 { .type = CRYPTO_ALG_TYPE_AEAD,
1515 .alg = { 1518 .alg.crypto = {
1516 .cra_name = "authenc(hmac(sha1),cbc(des3_ede))", 1519 .cra_name = "authenc(hmac(sha1),cbc(des3_ede))",
1517 .cra_driver_name = "authenc-hmac-sha1-cbc-3des-talitos", 1520 .cra_driver_name = "authenc-hmac-sha1-cbc-3des-talitos",
1518 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1521 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
@@ -1538,8 +1541,8 @@ static struct talitos_alg_template driver_algs[] = {
1538 DESC_HDR_MODE1_MDEU_PAD | 1541 DESC_HDR_MODE1_MDEU_PAD |
1539 DESC_HDR_MODE1_MDEU_SHA1_HMAC, 1542 DESC_HDR_MODE1_MDEU_SHA1_HMAC,
1540 }, 1543 },
1541 { 1544 { .type = CRYPTO_ALG_TYPE_AEAD,
1542 .alg = { 1545 .alg.crypto = {
1543 .cra_name = "authenc(hmac(sha256),cbc(aes))", 1546 .cra_name = "authenc(hmac(sha256),cbc(aes))",
1544 .cra_driver_name = "authenc-hmac-sha256-cbc-aes-talitos", 1547 .cra_driver_name = "authenc-hmac-sha256-cbc-aes-talitos",
1545 .cra_blocksize = AES_BLOCK_SIZE, 1548 .cra_blocksize = AES_BLOCK_SIZE,
@@ -1564,8 +1567,8 @@ static struct talitos_alg_template driver_algs[] = {
1564 DESC_HDR_MODE1_MDEU_PAD | 1567 DESC_HDR_MODE1_MDEU_PAD |
1565 DESC_HDR_MODE1_MDEU_SHA256_HMAC, 1568 DESC_HDR_MODE1_MDEU_SHA256_HMAC,
1566 }, 1569 },
1567 { 1570 { .type = CRYPTO_ALG_TYPE_AEAD,
1568 .alg = { 1571 .alg.crypto = {
1569 .cra_name = "authenc(hmac(sha256),cbc(des3_ede))", 1572 .cra_name = "authenc(hmac(sha256),cbc(des3_ede))",
1570 .cra_driver_name = "authenc-hmac-sha256-cbc-3des-talitos", 1573 .cra_driver_name = "authenc-hmac-sha256-cbc-3des-talitos",
1571 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1574 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
@@ -1591,8 +1594,8 @@ static struct talitos_alg_template driver_algs[] = {
1591 DESC_HDR_MODE1_MDEU_PAD | 1594 DESC_HDR_MODE1_MDEU_PAD |
1592 DESC_HDR_MODE1_MDEU_SHA256_HMAC, 1595 DESC_HDR_MODE1_MDEU_SHA256_HMAC,
1593 }, 1596 },
1594 { 1597 { .type = CRYPTO_ALG_TYPE_AEAD,
1595 .alg = { 1598 .alg.crypto = {
1596 .cra_name = "authenc(hmac(md5),cbc(aes))", 1599 .cra_name = "authenc(hmac(md5),cbc(aes))",
1597 .cra_driver_name = "authenc-hmac-md5-cbc-aes-talitos", 1600 .cra_driver_name = "authenc-hmac-md5-cbc-aes-talitos",
1598 .cra_blocksize = AES_BLOCK_SIZE, 1601 .cra_blocksize = AES_BLOCK_SIZE,
@@ -1617,8 +1620,8 @@ static struct talitos_alg_template driver_algs[] = {
1617 DESC_HDR_MODE1_MDEU_PAD | 1620 DESC_HDR_MODE1_MDEU_PAD |
1618 DESC_HDR_MODE1_MDEU_MD5_HMAC, 1621 DESC_HDR_MODE1_MDEU_MD5_HMAC,
1619 }, 1622 },
1620 { 1623 { .type = CRYPTO_ALG_TYPE_AEAD,
1621 .alg = { 1624 .alg.crypto = {
1622 .cra_name = "authenc(hmac(md5),cbc(des3_ede))", 1625 .cra_name = "authenc(hmac(md5),cbc(des3_ede))",
1623 .cra_driver_name = "authenc-hmac-md5-cbc-3des-talitos", 1626 .cra_driver_name = "authenc-hmac-md5-cbc-3des-talitos",
1624 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1627 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
@@ -1645,8 +1648,8 @@ static struct talitos_alg_template driver_algs[] = {
1645 DESC_HDR_MODE1_MDEU_MD5_HMAC, 1648 DESC_HDR_MODE1_MDEU_MD5_HMAC,
1646 }, 1649 },
1647 /* ABLKCIPHER algorithms. */ 1650 /* ABLKCIPHER algorithms. */
1648 { 1651 { .type = CRYPTO_ALG_TYPE_ABLKCIPHER,
1649 .alg = { 1652 .alg.crypto = {
1650 .cra_name = "cbc(aes)", 1653 .cra_name = "cbc(aes)",
1651 .cra_driver_name = "cbc-aes-talitos", 1654 .cra_driver_name = "cbc-aes-talitos",
1652 .cra_blocksize = AES_BLOCK_SIZE, 1655 .cra_blocksize = AES_BLOCK_SIZE,
@@ -1667,8 +1670,8 @@ static struct talitos_alg_template driver_algs[] = {
1667 DESC_HDR_SEL0_AESU | 1670 DESC_HDR_SEL0_AESU |
1668 DESC_HDR_MODE0_AESU_CBC, 1671 DESC_HDR_MODE0_AESU_CBC,
1669 }, 1672 },
1670 { 1673 { .type = CRYPTO_ALG_TYPE_ABLKCIPHER,
1671 .alg = { 1674 .alg.crypto = {
1672 .cra_name = "cbc(des3_ede)", 1675 .cra_name = "cbc(des3_ede)",
1673 .cra_driver_name = "cbc-3des-talitos", 1676 .cra_driver_name = "cbc-3des-talitos",
1674 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1677 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
@@ -1789,7 +1792,7 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
1789 return ERR_PTR(-ENOMEM); 1792 return ERR_PTR(-ENOMEM);
1790 1793
1791 alg = &t_alg->crypto_alg; 1794 alg = &t_alg->crypto_alg;
1792 *alg = template->alg; 1795 *alg = template->alg.crypto;
1793 1796
1794 alg->cra_module = THIS_MODULE; 1797 alg->cra_module = THIS_MODULE;
1795 alg->cra_init = talitos_cra_init; 1798 alg->cra_init = talitos_cra_init;