Signed-off-by: Yashpal Dutta <yashpal.du...@freescale.com>
---
 crypto/cryptodev.h     |    2 ++
 extras/eng_cryptodev.c |   21 +++++++++++++++++++++
 ioctl.c                |    8 ++++++++
 3 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/crypto/cryptodev.h b/crypto/cryptodev.h
index 00193a4..6382d43 100644
--- a/crypto/cryptodev.h
+++ b/crypto/cryptodev.h
@@ -45,9 +45,11 @@ enum cryptodev_crypto_op_t {
 
        CRYPTO_CAMELLIA_CBC = 101,
        CRYPTO_RIPEMD160,
+       CRYPTO_SHA2_224,
        CRYPTO_SHA2_256,
        CRYPTO_SHA2_384,
        CRYPTO_SHA2_512,
+       CRYPTO_SHA2_224_HMAC,
        CRYPTO_ALGORITHM_ALL, /* Keep updated - see below */
 };
 
diff --git a/extras/eng_cryptodev.c b/extras/eng_cryptodev.c
index 48eb0a5..51e6d61 100644
--- a/extras/eng_cryptodev.c
+++ b/extras/eng_cryptodev.c
@@ -912,6 +912,24 @@ static const EVP_MD cryptodev_sha256 = {
        SHA256_CBLOCK,
        sizeof(EVP_MD *)+sizeof(struct dev_crypto_state),
 };
+static const EVP_MD cryptodev_sha224 = {
+       NID_sha224,
+       NID_sha224WithRSAEncryption, 
+       SHA224_DIGEST_LENGTH, 
+#if defined(EVP_MD_FLAG_PKEY_METHOD_SIGNATURE) && 
defined(EVP_MD_FLAG_DIGALGID_ABSENT)
+       EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|
+       EVP_MD_FLAG_DIGALGID_ABSENT|
+#endif
+       EVP_MD_FLAG_ONESHOT,
+       cryptodev_digest_init,
+       cryptodev_digest_update,
+       cryptodev_digest_final,
+       cryptodev_digest_copy,
+       cryptodev_digest_cleanup,
+       EVP_PKEY_RSA_method,
+       SHA256_CBLOCK,
+       sizeof(EVP_MD *)+sizeof(struct dev_crypto_state),
+};
 
 static const EVP_MD cryptodev_sha384 = {
        NID_sha384,
@@ -988,6 +1006,9 @@ cryptodev_engine_digests(ENGINE *e, const EVP_MD **digest,
        case NID_sha1:
                *digest = &cryptodev_sha1;
                break;
+       case NID_sha224:
+               *digest = &cryptodev_sha224;
+               break;
        case NID_sha256:
                *digest = &cryptodev_sha256;
                break;
diff --git a/ioctl.c b/ioctl.c
index a81b601..0e7b2a5 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -164,6 +164,10 @@ crypto_create_session(struct fcrypt *fcr, struct 
session_op *sop)
        case CRYPTO_SHA1_HMAC:
                hash_name = "hmac(sha1)";
                break;
+       case CRYPTO_SHA2_224_HMAC:
+               hash_name = "hmac(sha224)";
+               break;
+
        case CRYPTO_SHA2_256_HMAC:
                hash_name = "hmac(sha256)";
                break;
@@ -187,6 +191,10 @@ crypto_create_session(struct fcrypt *fcr, struct 
session_op *sop)
                hash_name = "sha1";
                hmac_mode = 0;
                break;
+       case CRYPTO_SHA2_224:
+               hash_name = "sha224";
+               hmac_mode = 0;
+               break;
        case CRYPTO_SHA2_256:
                hash_name = "sha256";
                hmac_mode = 0;
-- 
1.7.0.4



_______________________________________________
Cryptodev-linux-devel mailing list
Cryptodev-linux-devel@gna.org
https://mail.gna.org/listinfo/cryptodev-linux-devel

Reply via email to