summaryrefslogtreecommitdiff
path: root/drivers/crypto/atmel-sha.c
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-12-05 09:53:46 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-11 16:37:03 +0800
commit7c783029eab847cedcbe85ece02b9faf6a576418 (patch)
tree1705e59bbacb31e602e83b0b66a78d004de04a56 /drivers/crypto/atmel-sha.c
parent7b49fabfc35c28deae514f07d563b0fb42c7cfea (diff)
crypto: atmel-{sha,tdes} - Change algorithm priorities
Increase the algorithm priorities so the hardware acceleration is now preferred to the software computation: the generic drivers use 100 as priority. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/atmel-sha.c')
-rw-r--r--drivers/crypto/atmel-sha.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/crypto/atmel-sha.c b/drivers/crypto/atmel-sha.c
index 9d392c5ff06b..12006fcd3fa8 100644
--- a/drivers/crypto/atmel-sha.c
+++ b/drivers/crypto/atmel-sha.c
@@ -40,6 +40,8 @@
#include "atmel-sha-regs.h"
#include "atmel-authenc.h"
+#define ATMEL_SHA_PRIORITY 300
+
/* SHA flags */
#define SHA_FLAGS_BUSY BIT(0)
#define SHA_FLAGS_FINAL BIT(1)
@@ -1263,7 +1265,7 @@ static struct ahash_alg sha_1_256_algs[] = {
.base = {
.cra_name = "sha1",
.cra_driver_name = "atmel-sha1",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA1_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_ctx),
@@ -1287,7 +1289,7 @@ static struct ahash_alg sha_1_256_algs[] = {
.base = {
.cra_name = "sha256",
.cra_driver_name = "atmel-sha256",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_ctx),
@@ -1313,7 +1315,7 @@ static struct ahash_alg sha_224_alg = {
.base = {
.cra_name = "sha224",
.cra_driver_name = "atmel-sha224",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA224_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_ctx),
@@ -1339,7 +1341,7 @@ static struct ahash_alg sha_384_512_algs[] = {
.base = {
.cra_name = "sha384",
.cra_driver_name = "atmel-sha384",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA384_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_ctx),
@@ -1363,7 +1365,7 @@ static struct ahash_alg sha_384_512_algs[] = {
.base = {
.cra_name = "sha512",
.cra_driver_name = "atmel-sha512",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA512_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_ctx),
@@ -2099,7 +2101,7 @@ static struct ahash_alg sha_hmac_algs[] = {
.base = {
.cra_name = "hmac(sha1)",
.cra_driver_name = "atmel-hmac-sha1",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA1_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx),
@@ -2124,7 +2126,7 @@ static struct ahash_alg sha_hmac_algs[] = {
.base = {
.cra_name = "hmac(sha224)",
.cra_driver_name = "atmel-hmac-sha224",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA224_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx),
@@ -2149,7 +2151,7 @@ static struct ahash_alg sha_hmac_algs[] = {
.base = {
.cra_name = "hmac(sha256)",
.cra_driver_name = "atmel-hmac-sha256",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA256_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx),
@@ -2174,7 +2176,7 @@ static struct ahash_alg sha_hmac_algs[] = {
.base = {
.cra_name = "hmac(sha384)",
.cra_driver_name = "atmel-hmac-sha384",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA384_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx),
@@ -2199,7 +2201,7 @@ static struct ahash_alg sha_hmac_algs[] = {
.base = {
.cra_name = "hmac(sha512)",
.cra_driver_name = "atmel-hmac-sha512",
- .cra_priority = 100,
+ .cra_priority = ATMEL_SHA_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC,
.cra_blocksize = SHA512_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct atmel_sha_hmac_ctx),