Commit b460edb6 authored by Antoine Tenart's avatar Antoine Tenart Committed by Herbert Xu

crypto: inside-secure - sha512 support

This patch adds the sha512 algorithm support to the Inside Secure
SafeXcel driver.
Signed-off-by: default avatarAntoine Tenart <antoine.tenart@bootlin.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 30c217ef
...@@ -790,6 +790,7 @@ static struct safexcel_alg_template *safexcel_algs[] = { ...@@ -790,6 +790,7 @@ static struct safexcel_alg_template *safexcel_algs[] = {
&safexcel_alg_sha1, &safexcel_alg_sha1,
&safexcel_alg_sha224, &safexcel_alg_sha224,
&safexcel_alg_sha256, &safexcel_alg_sha256,
&safexcel_alg_sha512,
&safexcel_alg_hmac_sha1, &safexcel_alg_hmac_sha1,
&safexcel_alg_hmac_sha224, &safexcel_alg_hmac_sha224,
&safexcel_alg_hmac_sha256, &safexcel_alg_hmac_sha256,
......
...@@ -313,6 +313,8 @@ struct safexcel_context_record { ...@@ -313,6 +313,8 @@ struct safexcel_context_record {
#define CONTEXT_CONTROL_CRYPTO_ALG_SHA1 (0x2 << 23) #define CONTEXT_CONTROL_CRYPTO_ALG_SHA1 (0x2 << 23)
#define CONTEXT_CONTROL_CRYPTO_ALG_SHA224 (0x4 << 23) #define CONTEXT_CONTROL_CRYPTO_ALG_SHA224 (0x4 << 23)
#define CONTEXT_CONTROL_CRYPTO_ALG_SHA256 (0x3 << 23) #define CONTEXT_CONTROL_CRYPTO_ALG_SHA256 (0x3 << 23)
#define CONTEXT_CONTROL_CRYPTO_ALG_SHA384 (0x6 << 23)
#define CONTEXT_CONTROL_CRYPTO_ALG_SHA512 (0x5 << 23)
#define CONTEXT_CONTROL_INV_FR (0x5 << 24) #define CONTEXT_CONTROL_INV_FR (0x5 << 24)
#define CONTEXT_CONTROL_INV_TR (0x6 << 24) #define CONTEXT_CONTROL_INV_TR (0x6 << 24)
...@@ -605,13 +607,13 @@ struct safexcel_context { ...@@ -605,13 +607,13 @@ struct safexcel_context {
}; };
struct safexcel_ahash_export_state { struct safexcel_ahash_export_state {
u64 len; u64 len[2];
u64 processed; u64 processed[2];
u32 digest; u32 digest;
u32 state[SHA256_DIGEST_SIZE / sizeof(u32)]; u32 state[SHA512_DIGEST_SIZE / sizeof(u32)];
u8 cache[SHA256_BLOCK_SIZE]; u8 cache[SHA512_BLOCK_SIZE];
}; };
/* /*
...@@ -670,6 +672,7 @@ extern struct safexcel_alg_template safexcel_alg_cbc_aes; ...@@ -670,6 +672,7 @@ extern struct safexcel_alg_template safexcel_alg_cbc_aes;
extern struct safexcel_alg_template safexcel_alg_sha1; extern struct safexcel_alg_template safexcel_alg_sha1;
extern struct safexcel_alg_template safexcel_alg_sha224; extern struct safexcel_alg_template safexcel_alg_sha224;
extern struct safexcel_alg_template safexcel_alg_sha256; extern struct safexcel_alg_template safexcel_alg_sha256;
extern struct safexcel_alg_template safexcel_alg_sha512;
extern struct safexcel_alg_template safexcel_alg_hmac_sha1; extern struct safexcel_alg_template safexcel_alg_hmac_sha1;
extern struct safexcel_alg_template safexcel_alg_hmac_sha224; extern struct safexcel_alg_template safexcel_alg_hmac_sha224;
extern struct safexcel_alg_template safexcel_alg_hmac_sha256; extern struct safexcel_alg_template safexcel_alg_hmac_sha256;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment