summaryrefslogtreecommitdiffstats
path: root/qemu/include/crypto/hash.h
diff options
context:
space:
mode:
authorJosé Pekkarinen <jose.pekkarinen@nokia.com>2016-05-18 13:18:31 +0300
committerJosé Pekkarinen <jose.pekkarinen@nokia.com>2016-05-18 13:42:15 +0300
commit437fd90c0250dee670290f9b714253671a990160 (patch)
treeb871786c360704244a07411c69fb58da9ead4a06 /qemu/include/crypto/hash.h
parent5bbd6fe9b8bab2a93e548c5a53b032d1939eec05 (diff)
These changes are the raw update to qemu-2.6.
Collission happened in the following patches: migration: do cleanup operation after completion(738df5b9) Bug fix.(1750c932f86) kvmclock: add a new function to update env->tsc.(b52baab2) The code provided by the patches was already in the upstreamed version. Change-Id: I3cc11841a6a76ae20887b2e245710199e1ea7f9a Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'qemu/include/crypto/hash.h')
-rw-r--r--qemu/include/crypto/hash.h35
1 files changed, 19 insertions, 16 deletions
diff --git a/qemu/include/crypto/hash.h b/qemu/include/crypto/hash.h
index b5acbf638..f38caed66 100644
--- a/qemu/include/crypto/hash.h
+++ b/qemu/include/crypto/hash.h
@@ -21,17 +21,9 @@
#ifndef QCRYPTO_HASH_H__
#define QCRYPTO_HASH_H__
-#include "qemu-common.h"
-#include "qapi/error.h"
-
-typedef enum {
- QCRYPTO_HASH_ALG_MD5,
- QCRYPTO_HASH_ALG_SHA1,
- QCRYPTO_HASH_ALG_SHA256,
-
- QCRYPTO_HASH_ALG_LAST
-} QCryptoHashAlgorithm;
+#include "qapi-types.h"
+/* See also "QCryptoHashAlgorithm" defined in qapi/crypto.json */
/**
* qcrypto_hash_supports:
@@ -44,6 +36,17 @@ typedef enum {
*/
gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg);
+
+/**
+ * qcrypto_hash_digest_len:
+ * @alg: the hash algorithm
+ *
+ * Determine the size of the hash digest in bytes
+ *
+ * Returns: the digest length in bytes
+ */
+size_t qcrypto_hash_digest_len(QCryptoHashAlgorithm alg);
+
/**
* qcrypto_hash_bytesv:
* @alg: the hash algorithm
@@ -51,7 +54,7 @@ gboolean qcrypto_hash_supports(QCryptoHashAlgorithm alg);
* @niov: the length of @iov
* @result: pointer to hold output hash
* @resultlen: pointer to hold length of @result
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory regions
* present in @iov. The @result pointer will be
@@ -76,7 +79,7 @@ int qcrypto_hash_bytesv(QCryptoHashAlgorithm alg,
* @len: the length of @buf
* @result: pointer to hold output hash
* @resultlen: pointer to hold length of @result
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory region
* @buf of length @len. The @result pointer will be
@@ -100,7 +103,7 @@ int qcrypto_hash_bytes(QCryptoHashAlgorithm alg,
* @iov: the array of memory regions to hash
* @niov: the length of @iov
* @digest: pointer to hold output hash
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory regions
* present in @iov. The @digest pointer will be
@@ -123,7 +126,7 @@ int qcrypto_hash_digestv(QCryptoHashAlgorithm alg,
* @buf: the memory region to hash
* @len: the length of @buf
* @digest: pointer to hold output hash
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory region
* @buf of length @len. The @digest pointer will be
@@ -146,7 +149,7 @@ int qcrypto_hash_digest(QCryptoHashAlgorithm alg,
* @iov: the array of memory regions to hash
* @niov: the length of @iov
* @base64: pointer to hold output hash
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory regions
* present in @iov. The @base64 pointer will be
@@ -169,7 +172,7 @@ int qcrypto_hash_base64v(QCryptoHashAlgorithm alg,
* @buf: the memory region to hash
* @len: the length of @buf
* @base64: pointer to hold output hash
- * @errp: pointer to uninitialized error object
+ * @errp: pointer to a NULL-initialized error object
*
* Computes the hash across all the memory region
* @buf of length @len. The @base64 pointer will be