aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorHemant Agrawal <hemant@freescale.com>2012-01-09 19:26:44 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2012-01-13 00:38:41 -0500
commite863f9ccc7658883be7b42eb63851aef9da7630c (patch)
treee1c447a029018191a54ebdf76ffa2d2e5b5e6d9e /drivers/crypto
parente7a2577a410a066ae409f805618f7e84748a537d (diff)
crypto: caam - add sha224 and sha384 variants to existing AEAD algorithms
Signed-off-by: Hemant Agrawal <hemant@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/caam/caamalg.c115
1 files changed, 115 insertions, 0 deletions
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index e9acadbb1d34..4cd2d84a2a15 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -1844,6 +1844,25 @@ static struct caam_alg_template driver_algs[] = {
1844 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC, 1844 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC,
1845 }, 1845 },
1846 { 1846 {
1847 .name = "authenc(hmac(sha224),cbc(aes))",
1848 .driver_name = "authenc-hmac-sha224-cbc-aes-caam",
1849 .blocksize = AES_BLOCK_SIZE,
1850 .template_aead = {
1851 .setkey = aead_setkey,
1852 .setauthsize = aead_setauthsize,
1853 .encrypt = aead_encrypt,
1854 .decrypt = aead_decrypt,
1855 .givencrypt = aead_givencrypt,
1856 .geniv = "<built-in>",
1857 .ivsize = AES_BLOCK_SIZE,
1858 .maxauthsize = SHA224_DIGEST_SIZE,
1859 },
1860 .class1_alg_type = OP_ALG_ALGSEL_AES | OP_ALG_AAI_CBC,
1861 .class2_alg_type = OP_ALG_ALGSEL_SHA224 |
1862 OP_ALG_AAI_HMAC_PRECOMP,
1863 .alg_op = OP_ALG_ALGSEL_SHA224 | OP_ALG_AAI_HMAC,
1864 },
1865 {
1847 .name = "authenc(hmac(sha256),cbc(aes))", 1866 .name = "authenc(hmac(sha256),cbc(aes))",
1848 .driver_name = "authenc-hmac-sha256-cbc-aes-caam", 1867 .driver_name = "authenc-hmac-sha256-cbc-aes-caam",
1849 .blocksize = AES_BLOCK_SIZE, 1868 .blocksize = AES_BLOCK_SIZE,
@@ -1864,6 +1883,26 @@ static struct caam_alg_template driver_algs[] = {
1864 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC, 1883 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC,
1865 }, 1884 },
1866 { 1885 {
1886 .name = "authenc(hmac(sha384),cbc(aes))",
1887 .driver_name = "authenc-hmac-sha384-cbc-aes-caam",
1888 .blocksize = AES_BLOCK_SIZE,
1889 .template_aead = {
1890 .setkey = aead_setkey,
1891 .setauthsize = aead_setauthsize,
1892 .encrypt = aead_encrypt,
1893 .decrypt = aead_decrypt,
1894 .givencrypt = aead_givencrypt,
1895 .geniv = "<built-in>",
1896 .ivsize = AES_BLOCK_SIZE,
1897 .maxauthsize = SHA384_DIGEST_SIZE,
1898 },
1899 .class1_alg_type = OP_ALG_ALGSEL_AES | OP_ALG_AAI_CBC,
1900 .class2_alg_type = OP_ALG_ALGSEL_SHA384 |
1901 OP_ALG_AAI_HMAC_PRECOMP,
1902 .alg_op = OP_ALG_ALGSEL_SHA384 | OP_ALG_AAI_HMAC,
1903 },
1904
1905 {
1867 .name = "authenc(hmac(sha512),cbc(aes))", 1906 .name = "authenc(hmac(sha512),cbc(aes))",
1868 .driver_name = "authenc-hmac-sha512-cbc-aes-caam", 1907 .driver_name = "authenc-hmac-sha512-cbc-aes-caam",
1869 .blocksize = AES_BLOCK_SIZE, 1908 .blocksize = AES_BLOCK_SIZE,
@@ -1922,6 +1961,25 @@ static struct caam_alg_template driver_algs[] = {
1922 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC, 1961 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC,
1923 }, 1962 },
1924 { 1963 {
1964 .name = "authenc(hmac(sha224),cbc(des3_ede))",
1965 .driver_name = "authenc-hmac-sha224-cbc-des3_ede-caam",
1966 .blocksize = DES3_EDE_BLOCK_SIZE,
1967 .template_aead = {
1968 .setkey = aead_setkey,
1969 .setauthsize = aead_setauthsize,
1970 .encrypt = aead_encrypt,
1971 .decrypt = aead_decrypt,
1972 .givencrypt = aead_givencrypt,
1973 .geniv = "<built-in>",
1974 .ivsize = DES3_EDE_BLOCK_SIZE,
1975 .maxauthsize = SHA224_DIGEST_SIZE,
1976 },
1977 .class1_alg_type = OP_ALG_ALGSEL_3DES | OP_ALG_AAI_CBC,
1978 .class2_alg_type = OP_ALG_ALGSEL_SHA224 |
1979 OP_ALG_AAI_HMAC_PRECOMP,
1980 .alg_op = OP_ALG_ALGSEL_SHA224 | OP_ALG_AAI_HMAC,
1981 },
1982 {
1925 .name = "authenc(hmac(sha256),cbc(des3_ede))", 1983 .name = "authenc(hmac(sha256),cbc(des3_ede))",
1926 .driver_name = "authenc-hmac-sha256-cbc-des3_ede-caam", 1984 .driver_name = "authenc-hmac-sha256-cbc-des3_ede-caam",
1927 .blocksize = DES3_EDE_BLOCK_SIZE, 1985 .blocksize = DES3_EDE_BLOCK_SIZE,
@@ -1942,6 +2000,25 @@ static struct caam_alg_template driver_algs[] = {
1942 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC, 2000 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC,
1943 }, 2001 },
1944 { 2002 {
2003 .name = "authenc(hmac(sha384),cbc(des3_ede))",
2004 .driver_name = "authenc-hmac-sha384-cbc-des3_ede-caam",
2005 .blocksize = DES3_EDE_BLOCK_SIZE,
2006 .template_aead = {
2007 .setkey = aead_setkey,
2008 .setauthsize = aead_setauthsize,
2009 .encrypt = aead_encrypt,
2010 .decrypt = aead_decrypt,
2011 .givencrypt = aead_givencrypt,
2012 .geniv = "<built-in>",
2013 .ivsize = DES3_EDE_BLOCK_SIZE,
2014 .maxauthsize = SHA384_DIGEST_SIZE,
2015 },
2016 .class1_alg_type = OP_ALG_ALGSEL_3DES | OP_ALG_AAI_CBC,
2017 .class2_alg_type = OP_ALG_ALGSEL_SHA384 |
2018 OP_ALG_AAI_HMAC_PRECOMP,
2019 .alg_op = OP_ALG_ALGSEL_SHA384 | OP_ALG_AAI_HMAC,
2020 },
2021 {
1945 .name = "authenc(hmac(sha512),cbc(des3_ede))", 2022 .name = "authenc(hmac(sha512),cbc(des3_ede))",
1946 .driver_name = "authenc-hmac-sha512-cbc-des3_ede-caam", 2023 .driver_name = "authenc-hmac-sha512-cbc-des3_ede-caam",
1947 .blocksize = DES3_EDE_BLOCK_SIZE, 2024 .blocksize = DES3_EDE_BLOCK_SIZE,
@@ -2000,6 +2077,25 @@ static struct caam_alg_template driver_algs[] = {
2000 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC, 2077 .alg_op = OP_ALG_ALGSEL_SHA1 | OP_ALG_AAI_HMAC,
2001 }, 2078 },
2002 { 2079 {
2080 .name = "authenc(hmac(sha224),cbc(des))",
2081 .driver_name = "authenc-hmac-sha224-cbc-des-caam",
2082 .blocksize = DES_BLOCK_SIZE,
2083 .template_aead = {
2084 .setkey = aead_setkey,
2085 .setauthsize = aead_setauthsize,
2086 .encrypt = aead_encrypt,
2087 .decrypt = aead_decrypt,
2088 .givencrypt = aead_givencrypt,
2089 .geniv = "<built-in>",
2090 .ivsize = DES_BLOCK_SIZE,
2091 .maxauthsize = SHA224_DIGEST_SIZE,
2092 },
2093 .class1_alg_type = OP_ALG_ALGSEL_DES | OP_ALG_AAI_CBC,
2094 .class2_alg_type = OP_ALG_ALGSEL_SHA224 |
2095 OP_ALG_AAI_HMAC_PRECOMP,
2096 .alg_op = OP_ALG_ALGSEL_SHA224 | OP_ALG_AAI_HMAC,
2097 },
2098 {
2003 .name = "authenc(hmac(sha256),cbc(des))", 2099 .name = "authenc(hmac(sha256),cbc(des))",
2004 .driver_name = "authenc-hmac-sha256-cbc-des-caam", 2100 .driver_name = "authenc-hmac-sha256-cbc-des-caam",
2005 .blocksize = DES_BLOCK_SIZE, 2101 .blocksize = DES_BLOCK_SIZE,
@@ -2020,6 +2116,25 @@ static struct caam_alg_template driver_algs[] = {
2020 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC, 2116 .alg_op = OP_ALG_ALGSEL_SHA256 | OP_ALG_AAI_HMAC,
2021 }, 2117 },
2022 { 2118 {
2119 .name = "authenc(hmac(sha384),cbc(des))",
2120 .driver_name = "authenc-hmac-sha384-cbc-des-caam",
2121 .blocksize = DES_BLOCK_SIZE,
2122 .template_aead = {
2123 .setkey = aead_setkey,
2124 .setauthsize = aead_setauthsize,
2125 .encrypt = aead_encrypt,
2126 .decrypt = aead_decrypt,
2127 .givencrypt = aead_givencrypt,
2128 .geniv = "<built-in>",
2129 .ivsize = DES_BLOCK_SIZE,
2130 .maxauthsize = SHA384_DIGEST_SIZE,
2131 },
2132 .class1_alg_type = OP_ALG_ALGSEL_DES | OP_ALG_AAI_CBC,
2133 .class2_alg_type = OP_ALG_ALGSEL_SHA384 |
2134 OP_ALG_AAI_HMAC_PRECOMP,
2135 .alg_op = OP_ALG_ALGSEL_SHA384 | OP_ALG_AAI_HMAC,
2136 },
2137 {
2023 .name = "authenc(hmac(sha512),cbc(des))", 2138 .name = "authenc(hmac(sha512),cbc(des))",
2024 .driver_name = "authenc-hmac-sha512-cbc-des-caam", 2139 .driver_name = "authenc-hmac-sha512-cbc-des-caam",
2025 .blocksize = DES_BLOCK_SIZE, 2140 .blocksize = DES_BLOCK_SIZE,