aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Phillips <kim.phillips@freescale.com>2012-08-08 21:33:34 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2012-08-28 11:53:53 -0400
commitb286e00304f9c1d27b93753536ac5246a287dd55 (patch)
tree80df5a8f8eccefcd758f6b5a2758d4c380a4473b
parentd4cd3283f67d08a18f83fbe7a26a10fe4b474b48 (diff)
crypto: talitos - consolidate common cra_* assignments
the entry points and geniv definitions for all aead, ablkcipher, and hash algorithms are all common; move them to a single assignment in talitos_alg_alloc(). This assumes it's ok to assign a setkey() on non-hmac algs. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/talitos.c163
1 files changed, 17 insertions, 146 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c
index 8a551595612a..b299f0902827 100644
--- a/drivers/crypto/talitos.c
+++ b/drivers/crypto/talitos.c
@@ -1910,12 +1910,6 @@ static struct talitos_alg_template driver_algs[] = {
1910 .cra_blocksize = AES_BLOCK_SIZE, 1910 .cra_blocksize = AES_BLOCK_SIZE,
1911 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 1911 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
1912 .cra_aead = { 1912 .cra_aead = {
1913 .setkey = aead_setkey,
1914 .setauthsize = aead_setauthsize,
1915 .encrypt = aead_encrypt,
1916 .decrypt = aead_decrypt,
1917 .givencrypt = aead_givencrypt,
1918 .geniv = "<built-in>",
1919 .ivsize = AES_BLOCK_SIZE, 1913 .ivsize = AES_BLOCK_SIZE,
1920 .maxauthsize = SHA1_DIGEST_SIZE, 1914 .maxauthsize = SHA1_DIGEST_SIZE,
1921 } 1915 }
@@ -1935,12 +1929,6 @@ static struct talitos_alg_template driver_algs[] = {
1935 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1929 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
1936 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 1930 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
1937 .cra_aead = { 1931 .cra_aead = {
1938 .setkey = aead_setkey,
1939 .setauthsize = aead_setauthsize,
1940 .encrypt = aead_encrypt,
1941 .decrypt = aead_decrypt,
1942 .givencrypt = aead_givencrypt,
1943 .geniv = "<built-in>",
1944 .ivsize = DES3_EDE_BLOCK_SIZE, 1932 .ivsize = DES3_EDE_BLOCK_SIZE,
1945 .maxauthsize = SHA1_DIGEST_SIZE, 1933 .maxauthsize = SHA1_DIGEST_SIZE,
1946 } 1934 }
@@ -1961,12 +1949,6 @@ static struct talitos_alg_template driver_algs[] = {
1961 .cra_blocksize = AES_BLOCK_SIZE, 1949 .cra_blocksize = AES_BLOCK_SIZE,
1962 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 1950 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
1963 .cra_aead = { 1951 .cra_aead = {
1964 .setkey = aead_setkey,
1965 .setauthsize = aead_setauthsize,
1966 .encrypt = aead_encrypt,
1967 .decrypt = aead_decrypt,
1968 .givencrypt = aead_givencrypt,
1969 .geniv = "<built-in>",
1970 .ivsize = AES_BLOCK_SIZE, 1952 .ivsize = AES_BLOCK_SIZE,
1971 .maxauthsize = SHA224_DIGEST_SIZE, 1953 .maxauthsize = SHA224_DIGEST_SIZE,
1972 } 1954 }
@@ -1986,12 +1968,6 @@ static struct talitos_alg_template driver_algs[] = {
1986 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 1968 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
1987 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 1969 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
1988 .cra_aead = { 1970 .cra_aead = {
1989 .setkey = aead_setkey,
1990 .setauthsize = aead_setauthsize,
1991 .encrypt = aead_encrypt,
1992 .decrypt = aead_decrypt,
1993 .givencrypt = aead_givencrypt,
1994 .geniv = "<built-in>",
1995 .ivsize = DES3_EDE_BLOCK_SIZE, 1971 .ivsize = DES3_EDE_BLOCK_SIZE,
1996 .maxauthsize = SHA224_DIGEST_SIZE, 1972 .maxauthsize = SHA224_DIGEST_SIZE,
1997 } 1973 }
@@ -2012,12 +1988,6 @@ static struct talitos_alg_template driver_algs[] = {
2012 .cra_blocksize = AES_BLOCK_SIZE, 1988 .cra_blocksize = AES_BLOCK_SIZE,
2013 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 1989 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2014 .cra_aead = { 1990 .cra_aead = {
2015 .setkey = aead_setkey,
2016 .setauthsize = aead_setauthsize,
2017 .encrypt = aead_encrypt,
2018 .decrypt = aead_decrypt,
2019 .givencrypt = aead_givencrypt,
2020 .geniv = "<built-in>",
2021 .ivsize = AES_BLOCK_SIZE, 1991 .ivsize = AES_BLOCK_SIZE,
2022 .maxauthsize = SHA256_DIGEST_SIZE, 1992 .maxauthsize = SHA256_DIGEST_SIZE,
2023 } 1993 }
@@ -2037,12 +2007,6 @@ static struct talitos_alg_template driver_algs[] = {
2037 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 2007 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
2038 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2008 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2039 .cra_aead = { 2009 .cra_aead = {
2040 .setkey = aead_setkey,
2041 .setauthsize = aead_setauthsize,
2042 .encrypt = aead_encrypt,
2043 .decrypt = aead_decrypt,
2044 .givencrypt = aead_givencrypt,
2045 .geniv = "<built-in>",
2046 .ivsize = DES3_EDE_BLOCK_SIZE, 2010 .ivsize = DES3_EDE_BLOCK_SIZE,
2047 .maxauthsize = SHA256_DIGEST_SIZE, 2011 .maxauthsize = SHA256_DIGEST_SIZE,
2048 } 2012 }
@@ -2063,12 +2027,6 @@ static struct talitos_alg_template driver_algs[] = {
2063 .cra_blocksize = AES_BLOCK_SIZE, 2027 .cra_blocksize = AES_BLOCK_SIZE,
2064 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2028 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2065 .cra_aead = { 2029 .cra_aead = {
2066 .setkey = aead_setkey,
2067 .setauthsize = aead_setauthsize,
2068 .encrypt = aead_encrypt,
2069 .decrypt = aead_decrypt,
2070 .givencrypt = aead_givencrypt,
2071 .geniv = "<built-in>",
2072 .ivsize = AES_BLOCK_SIZE, 2030 .ivsize = AES_BLOCK_SIZE,
2073 .maxauthsize = SHA384_DIGEST_SIZE, 2031 .maxauthsize = SHA384_DIGEST_SIZE,
2074 } 2032 }
@@ -2088,12 +2046,6 @@ static struct talitos_alg_template driver_algs[] = {
2088 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 2046 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
2089 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2047 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2090 .cra_aead = { 2048 .cra_aead = {
2091 .setkey = aead_setkey,
2092 .setauthsize = aead_setauthsize,
2093 .encrypt = aead_encrypt,
2094 .decrypt = aead_decrypt,
2095 .givencrypt = aead_givencrypt,
2096 .geniv = "<built-in>",
2097 .ivsize = DES3_EDE_BLOCK_SIZE, 2049 .ivsize = DES3_EDE_BLOCK_SIZE,
2098 .maxauthsize = SHA384_DIGEST_SIZE, 2050 .maxauthsize = SHA384_DIGEST_SIZE,
2099 } 2051 }
@@ -2114,12 +2066,6 @@ static struct talitos_alg_template driver_algs[] = {
2114 .cra_blocksize = AES_BLOCK_SIZE, 2066 .cra_blocksize = AES_BLOCK_SIZE,
2115 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2067 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2116 .cra_aead = { 2068 .cra_aead = {
2117 .setkey = aead_setkey,
2118 .setauthsize = aead_setauthsize,
2119 .encrypt = aead_encrypt,
2120 .decrypt = aead_decrypt,
2121 .givencrypt = aead_givencrypt,
2122 .geniv = "<built-in>",
2123 .ivsize = AES_BLOCK_SIZE, 2069 .ivsize = AES_BLOCK_SIZE,
2124 .maxauthsize = SHA512_DIGEST_SIZE, 2070 .maxauthsize = SHA512_DIGEST_SIZE,
2125 } 2071 }
@@ -2139,12 +2085,6 @@ static struct talitos_alg_template driver_algs[] = {
2139 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 2085 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
2140 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2086 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2141 .cra_aead = { 2087 .cra_aead = {
2142 .setkey = aead_setkey,
2143 .setauthsize = aead_setauthsize,
2144 .encrypt = aead_encrypt,
2145 .decrypt = aead_decrypt,
2146 .givencrypt = aead_givencrypt,
2147 .geniv = "<built-in>",
2148 .ivsize = DES3_EDE_BLOCK_SIZE, 2088 .ivsize = DES3_EDE_BLOCK_SIZE,
2149 .maxauthsize = SHA512_DIGEST_SIZE, 2089 .maxauthsize = SHA512_DIGEST_SIZE,
2150 } 2090 }
@@ -2165,12 +2105,6 @@ static struct talitos_alg_template driver_algs[] = {
2165 .cra_blocksize = AES_BLOCK_SIZE, 2105 .cra_blocksize = AES_BLOCK_SIZE,
2166 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2106 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2167 .cra_aead = { 2107 .cra_aead = {
2168 .setkey = aead_setkey,
2169 .setauthsize = aead_setauthsize,
2170 .encrypt = aead_encrypt,
2171 .decrypt = aead_decrypt,
2172 .givencrypt = aead_givencrypt,
2173 .geniv = "<built-in>",
2174 .ivsize = AES_BLOCK_SIZE, 2108 .ivsize = AES_BLOCK_SIZE,
2175 .maxauthsize = MD5_DIGEST_SIZE, 2109 .maxauthsize = MD5_DIGEST_SIZE,
2176 } 2110 }
@@ -2190,12 +2124,6 @@ static struct talitos_alg_template driver_algs[] = {
2190 .cra_blocksize = DES3_EDE_BLOCK_SIZE, 2124 .cra_blocksize = DES3_EDE_BLOCK_SIZE,
2191 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC, 2125 .cra_flags = CRYPTO_ALG_TYPE_AEAD | CRYPTO_ALG_ASYNC,
2192 .cra_aead = { 2126 .cra_aead = {
2193 .setkey = aead_setkey,
2194 .setauthsize = aead_setauthsize,
2195 .encrypt = aead_encrypt,
2196 .decrypt = aead_decrypt,
2197 .givencrypt = aead_givencrypt,
2198 .geniv = "<built-in>",
2199 .ivsize = DES3_EDE_BLOCK_SIZE, 2127 .ivsize = DES3_EDE_BLOCK_SIZE,
2200 .maxauthsize = MD5_DIGEST_SIZE, 2128 .maxauthsize = MD5_DIGEST_SIZE,
2201 } 2129 }
@@ -2218,10 +2146,6 @@ static struct talitos_alg_template driver_algs[] = {
2218 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | 2146 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
2219 CRYPTO_ALG_ASYNC, 2147 CRYPTO_ALG_ASYNC,
2220 .cra_ablkcipher = { 2148 .cra_ablkcipher = {
2221 .setkey = ablkcipher_setkey,
2222 .encrypt = ablkcipher_encrypt,
2223 .decrypt = ablkcipher_decrypt,
2224 .geniv = "eseqiv",
2225 .min_keysize = AES_MIN_KEY_SIZE, 2149 .min_keysize = AES_MIN_KEY_SIZE,
2226 .max_keysize = AES_MAX_KEY_SIZE, 2150 .max_keysize = AES_MAX_KEY_SIZE,
2227 .ivsize = AES_BLOCK_SIZE, 2151 .ivsize = AES_BLOCK_SIZE,
@@ -2239,10 +2163,6 @@ static struct talitos_alg_template driver_algs[] = {
2239 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | 2163 .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER |
2240 CRYPTO_ALG_ASYNC, 2164 CRYPTO_ALG_ASYNC,
2241 .cra_ablkcipher = { 2165 .cra_ablkcipher = {
2242 .setkey = ablkcipher_setkey,
2243 .encrypt = ablkcipher_encrypt,
2244 .decrypt = ablkcipher_decrypt,
2245 .geniv = "eseqiv",
2246 .min_keysize = DES3_EDE_KEY_SIZE, 2166 .min_keysize = DES3_EDE_KEY_SIZE,
2247 .max_keysize = DES3_EDE_KEY_SIZE, 2167 .max_keysize = DES3_EDE_KEY_SIZE,
2248 .ivsize = DES3_EDE_BLOCK_SIZE, 2168 .ivsize = DES3_EDE_BLOCK_SIZE,
@@ -2256,11 +2176,6 @@ static struct talitos_alg_template driver_algs[] = {
2256 /* AHASH algorithms. */ 2176 /* AHASH algorithms. */
2257 { .type = CRYPTO_ALG_TYPE_AHASH, 2177 { .type = CRYPTO_ALG_TYPE_AHASH,
2258 .alg.hash = { 2178 .alg.hash = {
2259 .init = ahash_init,
2260 .update = ahash_update,
2261 .final = ahash_final,
2262 .finup = ahash_finup,
2263 .digest = ahash_digest,
2264 .halg.digestsize = MD5_DIGEST_SIZE, 2179 .halg.digestsize = MD5_DIGEST_SIZE,
2265 .halg.base = { 2180 .halg.base = {
2266 .cra_name = "md5", 2181 .cra_name = "md5",
@@ -2276,11 +2191,6 @@ static struct talitos_alg_template driver_algs[] = {
2276 }, 2191 },
2277 { .type = CRYPTO_ALG_TYPE_AHASH, 2192 { .type = CRYPTO_ALG_TYPE_AHASH,
2278 .alg.hash = { 2193 .alg.hash = {
2279 .init = ahash_init,
2280 .update = ahash_update,
2281 .final = ahash_final,
2282 .finup = ahash_finup,
2283 .digest = ahash_digest,
2284 .halg.digestsize = SHA1_DIGEST_SIZE, 2194 .halg.digestsize = SHA1_DIGEST_SIZE,
2285 .halg.base = { 2195 .halg.base = {
2286 .cra_name = "sha1", 2196 .cra_name = "sha1",
@@ -2296,11 +2206,6 @@ static struct talitos_alg_template driver_algs[] = {
2296 }, 2206 },
2297 { .type = CRYPTO_ALG_TYPE_AHASH, 2207 { .type = CRYPTO_ALG_TYPE_AHASH,
2298 .alg.hash = { 2208 .alg.hash = {
2299 .init = ahash_init,
2300 .update = ahash_update,
2301 .final = ahash_final,
2302 .finup = ahash_finup,
2303 .digest = ahash_digest,
2304 .halg.digestsize = SHA224_DIGEST_SIZE, 2209 .halg.digestsize = SHA224_DIGEST_SIZE,
2305 .halg.base = { 2210 .halg.base = {
2306 .cra_name = "sha224", 2211 .cra_name = "sha224",
@@ -2316,11 +2221,6 @@ static struct talitos_alg_template driver_algs[] = {
2316 }, 2221 },
2317 { .type = CRYPTO_ALG_TYPE_AHASH, 2222 { .type = CRYPTO_ALG_TYPE_AHASH,
2318 .alg.hash = { 2223 .alg.hash = {
2319 .init = ahash_init,
2320 .update = ahash_update,
2321 .final = ahash_final,
2322 .finup = ahash_finup,
2323 .digest = ahash_digest,
2324 .halg.digestsize = SHA256_DIGEST_SIZE, 2224 .halg.digestsize = SHA256_DIGEST_SIZE,
2325 .halg.base = { 2225 .halg.base = {
2326 .cra_name = "sha256", 2226 .cra_name = "sha256",
@@ -2336,11 +2236,6 @@ static struct talitos_alg_template driver_algs[] = {
2336 }, 2236 },
2337 { .type = CRYPTO_ALG_TYPE_AHASH, 2237 { .type = CRYPTO_ALG_TYPE_AHASH,
2338 .alg.hash = { 2238 .alg.hash = {
2339 .init = ahash_init,
2340 .update = ahash_update,
2341 .final = ahash_final,
2342 .finup = ahash_finup,
2343 .digest = ahash_digest,
2344 .halg.digestsize = SHA384_DIGEST_SIZE, 2239 .halg.digestsize = SHA384_DIGEST_SIZE,
2345 .halg.base = { 2240 .halg.base = {
2346 .cra_name = "sha384", 2241 .cra_name = "sha384",
@@ -2356,11 +2251,6 @@ static struct talitos_alg_template driver_algs[] = {
2356 }, 2251 },
2357 { .type = CRYPTO_ALG_TYPE_AHASH, 2252 { .type = CRYPTO_ALG_TYPE_AHASH,
2358 .alg.hash = { 2253 .alg.hash = {
2359 .init = ahash_init,
2360 .update = ahash_update,
2361 .final = ahash_final,
2362 .finup = ahash_finup,
2363 .digest = ahash_digest,
2364 .halg.digestsize = SHA512_DIGEST_SIZE, 2254 .halg.digestsize = SHA512_DIGEST_SIZE,
2365 .halg.base = { 2255 .halg.base = {
2366 .cra_name = "sha512", 2256 .cra_name = "sha512",
@@ -2376,12 +2266,6 @@ static struct talitos_alg_template driver_algs[] = {
2376 }, 2266 },
2377 { .type = CRYPTO_ALG_TYPE_AHASH, 2267 { .type = CRYPTO_ALG_TYPE_AHASH,
2378 .alg.hash = { 2268 .alg.hash = {
2379 .init = ahash_init,
2380 .update = ahash_update,
2381 .final = ahash_final,
2382 .finup = ahash_finup,
2383 .digest = ahash_digest,
2384 .setkey = ahash_setkey,
2385 .halg.digestsize = MD5_DIGEST_SIZE, 2269 .halg.digestsize = MD5_DIGEST_SIZE,
2386 .halg.base = { 2270 .halg.base = {
2387 .cra_name = "hmac(md5)", 2271 .cra_name = "hmac(md5)",
@@ -2397,12 +2281,6 @@ static struct talitos_alg_template driver_algs[] = {
2397 }, 2281 },
2398 { .type = CRYPTO_ALG_TYPE_AHASH, 2282 { .type = CRYPTO_ALG_TYPE_AHASH,
2399 .alg.hash = { 2283 .alg.hash = {
2400 .init = ahash_init,
2401 .update = ahash_update,
2402 .final = ahash_final,
2403 .finup = ahash_finup,
2404 .digest = ahash_digest,
2405 .setkey = ahash_setkey,
2406 .halg.digestsize = SHA1_DIGEST_SIZE, 2284 .halg.digestsize = SHA1_DIGEST_SIZE,
2407 .halg.base = { 2285 .halg.base = {
2408 .cra_name = "hmac(sha1)", 2286 .cra_name = "hmac(sha1)",
@@ -2418,12 +2296,6 @@ static struct talitos_alg_template driver_algs[] = {
2418 }, 2296 },
2419 { .type = CRYPTO_ALG_TYPE_AHASH, 2297 { .type = CRYPTO_ALG_TYPE_AHASH,
2420 .alg.hash = { 2298 .alg.hash = {
2421 .init = ahash_init,
2422 .update = ahash_update,
2423 .final = ahash_final,
2424 .finup = ahash_finup,
2425 .digest = ahash_digest,
2426 .setkey = ahash_setkey,
2427 .halg.digestsize = SHA224_DIGEST_SIZE, 2299 .halg.digestsize = SHA224_DIGEST_SIZE,
2428 .halg.base = { 2300 .halg.base = {
2429 .cra_name = "hmac(sha224)", 2301 .cra_name = "hmac(sha224)",
@@ -2439,12 +2311,6 @@ static struct talitos_alg_template driver_algs[] = {
2439 }, 2311 },
2440 { .type = CRYPTO_ALG_TYPE_AHASH, 2312 { .type = CRYPTO_ALG_TYPE_AHASH,
2441 .alg.hash = { 2313 .alg.hash = {
2442 .init = ahash_init,
2443 .update = ahash_update,
2444 .final = ahash_final,
2445 .finup = ahash_finup,
2446 .digest = ahash_digest,
2447 .setkey = ahash_setkey,
2448 .halg.digestsize = SHA256_DIGEST_SIZE, 2314 .halg.digestsize = SHA256_DIGEST_SIZE,
2449 .halg.base = { 2315 .halg.base = {
2450 .cra_name = "hmac(sha256)", 2316 .cra_name = "hmac(sha256)",
@@ -2460,12 +2326,6 @@ static struct talitos_alg_template driver_algs[] = {
2460 }, 2326 },
2461 { .type = CRYPTO_ALG_TYPE_AHASH, 2327 { .type = CRYPTO_ALG_TYPE_AHASH,
2462 .alg.hash = { 2328 .alg.hash = {
2463 .init = ahash_init,
2464 .update = ahash_update,
2465 .final = ahash_final,
2466 .finup = ahash_finup,
2467 .digest = ahash_digest,
2468 .setkey = ahash_setkey,
2469 .halg.digestsize = SHA384_DIGEST_SIZE, 2329 .halg.digestsize = SHA384_DIGEST_SIZE,
2470 .halg.base = { 2330 .halg.base = {
2471 .cra_name = "hmac(sha384)", 2331 .cra_name = "hmac(sha384)",
@@ -2481,12 +2341,6 @@ static struct talitos_alg_template driver_algs[] = {
2481 }, 2341 },
2482 { .type = CRYPTO_ALG_TYPE_AHASH, 2342 { .type = CRYPTO_ALG_TYPE_AHASH,
2483 .alg.hash = { 2343 .alg.hash = {
2484 .init = ahash_init,
2485 .update = ahash_update,
2486 .final = ahash_final,
2487 .finup = ahash_finup,
2488 .digest = ahash_digest,
2489 .setkey = ahash_setkey,
2490 .halg.digestsize = SHA512_DIGEST_SIZE, 2344 .halg.digestsize = SHA512_DIGEST_SIZE,
2491 .halg.base = { 2345 .halg.base = {
2492 .cra_name = "hmac(sha512)", 2346 .cra_name = "hmac(sha512)",
@@ -2652,16 +2506,33 @@ static struct talitos_crypto_alg *talitos_alg_alloc(struct device *dev,
2652 alg = &t_alg->algt.alg.crypto; 2506 alg = &t_alg->algt.alg.crypto;
2653 alg->cra_init = talitos_cra_init; 2507 alg->cra_init = talitos_cra_init;
2654 alg->cra_type = &crypto_ablkcipher_type; 2508 alg->cra_type = &crypto_ablkcipher_type;
2509 alg->cra_ablkcipher.setkey = ablkcipher_setkey;
2510 alg->cra_ablkcipher.encrypt = ablkcipher_encrypt;
2511 alg->cra_ablkcipher.decrypt = ablkcipher_decrypt;
2512 alg->cra_ablkcipher.geniv = "eseqiv";
2655 break; 2513 break;
2656 case CRYPTO_ALG_TYPE_AEAD: 2514 case CRYPTO_ALG_TYPE_AEAD:
2657 alg = &t_alg->algt.alg.crypto; 2515 alg = &t_alg->algt.alg.crypto;
2658 alg->cra_init = talitos_cra_init_aead; 2516 alg->cra_init = talitos_cra_init_aead;
2659 alg->cra_type = &crypto_aead_type; 2517 alg->cra_type = &crypto_aead_type;
2518 alg->cra_aead.setkey = aead_setkey;
2519 alg->cra_aead.setauthsize = aead_setauthsize;
2520 alg->cra_aead.encrypt = aead_encrypt;
2521 alg->cra_aead.decrypt = aead_decrypt;
2522 alg->cra_aead.givencrypt = aead_givencrypt;
2523 alg->cra_aead.geniv = "<built-in>";
2660 break; 2524 break;
2661 case CRYPTO_ALG_TYPE_AHASH: 2525 case CRYPTO_ALG_TYPE_AHASH:
2662 alg = &t_alg->algt.alg.hash.halg.base; 2526 alg = &t_alg->algt.alg.hash.halg.base;
2663 alg->cra_init = talitos_cra_init_ahash; 2527 alg->cra_init = talitos_cra_init_ahash;
2664 alg->cra_type = &crypto_ahash_type; 2528 alg->cra_type = &crypto_ahash_type;
2529 t_alg->algt.alg.hash.init = ahash_init;
2530 t_alg->algt.alg.hash.update = ahash_update;
2531 t_alg->algt.alg.hash.final = ahash_final;
2532 t_alg->algt.alg.hash.finup = ahash_finup;
2533 t_alg->algt.alg.hash.digest = ahash_digest;
2534 t_alg->algt.alg.hash.setkey = ahash_setkey;
2535
2665 if (!(priv->features & TALITOS_FTR_HMAC_OK) && 2536 if (!(priv->features & TALITOS_FTR_HMAC_OK) &&
2666 !strncmp(alg->cra_name, "hmac", 4)) { 2537 !strncmp(alg->cra_name, "hmac", 4)) {
2667 kfree(t_alg); 2538 kfree(t_alg);