summaryrefslogtreecommitdiff
path: root/trust/oid.c
diff options
context:
space:
mode:
Diffstat (limited to 'trust/oid.c')
-rw-r--r--trust/oid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/trust/oid.c b/trust/oid.c
index b4b0bf6..dff4148 100644
--- a/trust/oid.c
+++ b/trust/oid.c
@@ -34,10 +34,12 @@
#include "config.h"
+#include "hash.h"
#include "oid.h"
#include <assert.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
/*
@@ -60,6 +62,17 @@ p11_oid_simple (const unsigned char *oid,
(size_t)oid[1] == len - 2); /* matches length */
}
+unsigned int
+p11_oid_hash (const void *oid)
+{
+ uint32_t hash;
+ int len;
+
+ len = p11_oid_length (oid);
+ p11_hash_murmur3 (&hash, oid, len, NULL);
+ return hash;
+}
+
bool
p11_oid_equal (const void *oid_one,
const void *oid_two)