]> xenbits.xensource.com Git - libvirt.git/commitdiff
vircrypto: provide constants for hash sizes
authorJán Tomko <jtomko@redhat.com>
Fri, 11 May 2018 13:42:35 +0000 (15:42 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 14 May 2018 11:55:47 +0000 (13:55 +0200)
The callers needing to know the size of the resulting digest
rely on _DIGEST_SIZE constants from gnulib.

Introduce VIR_CRYPTO_HASH_SIZE_ constants to remove the dependency.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
src/util/vircrypto.h

index 068602f5dfc435b48dcb43c5eabc070c27c15536..81743d2f74cac7f8752cdfb73b53fb833955665f 100644 (file)
@@ -23,6 +23,9 @@
 
 # include "internal.h"
 
+# define VIR_CRYPTO_HASH_SIZE_MD5 16
+# define VIR_CRYPTO_HASH_SIZE_SHA256 32
+
 typedef enum {
     VIR_CRYPTO_HASH_MD5, /* Don't use this except for historic compat */
     VIR_CRYPTO_HASH_SHA256,