summaryrefslogtreecommitdiffstats
path: root/crypto/hash-gcrypt.c
diff options
context:
space:
mode:
authorDaniel P. Berrange2016-03-11 19:33:08 +0100
committerDaniel P. Berrange2016-07-04 16:52:36 +0200
commit9164b89762224db414676973172c26994aa9e2e5 (patch)
treedb509ee669f5195c4d240b45929854ab7a06a1f3 /crypto/hash-gcrypt.c
parentcrypto: switch hash code to use nettle/gcrypt directly (diff)
downloadqemu-9164b89762224db414676973172c26994aa9e2e5.tar.gz
qemu-9164b89762224db414676973172c26994aa9e2e5.tar.xz
qemu-9164b89762224db414676973172c26994aa9e2e5.zip
crypto: implement sha224, sha384, sha512 and ripemd160 hashes
Wire up the nettle and gcrypt hash backends so that they can support the sha224, sha384, sha512 and ripemd160 hash algorithms. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto/hash-gcrypt.c')
-rw-r--r--crypto/hash-gcrypt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/hash-gcrypt.c b/crypto/hash-gcrypt.c
index e0456897ac..8ea5aff4ee 100644
--- a/crypto/hash-gcrypt.c
+++ b/crypto/hash-gcrypt.c
@@ -27,7 +27,11 @@
static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALG__MAX] = {
[QCRYPTO_HASH_ALG_MD5] = GCRY_MD_MD5,
[QCRYPTO_HASH_ALG_SHA1] = GCRY_MD_SHA1,
+ [QCRYPTO_HASH_ALG_SHA224] = GCRY_MD_SHA224,
[QCRYPTO_HASH_ALG_SHA256] = GCRY_MD_SHA256,
+ [QCRYPTO_HASH_ALG_SHA384] = GCRY_MD_SHA384,
+ [QCRYPTO_HASH_ALG_SHA512] = GCRY_MD_SHA512,
+ [QCRYPTO_HASH_ALG_RIPEMD160] = GCRY_MD_RMD160,
};
gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg)