MEDIUM: xxhash: use the XXH3 functions to generate 64-bit hashes

Replace the XXH64() function calls with the XXH3 variant function
XXH3_64bits_withSeed() where possible.
diff --git a/include/haproxy/compat.h b/include/haproxy/compat.h
index 581141c..76cf350 100644
--- a/include/haproxy/compat.h
+++ b/include/haproxy/compat.h
@@ -254,6 +254,13 @@
  */
 #define MAX_SEND_FD 253
 
+/* Make the new complex name for the xxhash function easier to remember
+ * and use.
+ */
+#ifndef XXH3
+#define XXH3(data, len, seed) XXH3_64bits_withSeed(data, len, seed)
+#endif
+
 #endif /* _HAPROXY_COMPAT_H */
 
 /*
diff --git a/src/51d.c b/src/51d.c
index 31d7c3f..fda0171 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -305,9 +305,9 @@
 	int i;
 	for(i = 0; i < ws->importantHeadersCount; i++) {
 		hash ^= ws->importantHeaders[i].header->headerNameOffset;
-		hash ^= XXH64(ws->importantHeaders[i].headerValue,
-		              ws->importantHeaders[i].headerValueLength,
-		              seed);
+		hash ^= XXH3(ws->importantHeaders[i].headerValue,
+		             ws->importantHeaders[i].headerValueLength,
+		             seed);
 	}
 	return hash;
 }
@@ -517,7 +517,7 @@
 		unsigned long long seed = _51d_lru_seed ^ (long)args;
 
 		HA_SPIN_LOCK(OTHER_LOCK, &_51d_lru_lock);
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 		                _51d_lru_tree, (void*)args, 0);
 		if (lru && lru->domain) {
 			_51d_retrieve_cache_entry(smp, lru);
diff --git a/src/pattern.c b/src/pattern.c
index e62d0d0..7c260f3 100644
--- a/src/pattern.c
+++ b/src/pattern.c
@@ -494,7 +494,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
@@ -537,7 +537,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
@@ -606,7 +606,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
@@ -689,7 +689,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
@@ -733,7 +733,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
@@ -781,7 +781,7 @@
 	if (pat_lru_tree) {
 		unsigned long long seed = pat_lru_seed ^ (long)expr;
 
-		lru = lru64_get(XXH64(smp->data.u.str.area, smp->data.u.str.data, seed),
+		lru = lru64_get(XXH3(smp->data.u.str.area, smp->data.u.str.data, seed),
 				pat_lru_tree, expr, expr->ref->revision);
 		if (lru && lru->domain) {
 			ret = lru->data;
diff --git a/src/ssl_sock.c b/src/ssl_sock.c
index 766f200..22144c3 100644
--- a/src/ssl_sock.c
+++ b/src/ssl_sock.c
@@ -6242,7 +6242,7 @@
 		memprintf(err, "unable to load issuers-chain %s : SubjectName not found.\n", fp);
 		goto end;
 	}
-	key = XXH64(ASN1_STRING_get0_data(skid), ASN1_STRING_length(skid), 0);
+	key = XXH3(ASN1_STRING_get0_data(skid), ASN1_STRING_length(skid), 0);
 	for (node = eb64_lookup(&cert_issuer_tree, key); node; node = eb64_next(node)) {
 		issuer = container_of(node, typeof(*issuer), node);
 		if (!X509_NAME_cmp(name, X509_get_subject_name(sk_X509_value(issuer->chain, 0)))) {
@@ -6280,7 +6280,7 @@
 	if (akid && akid->keyid) {
 		struct eb64_node *node;
 		u64 hk;
-		hk = XXH64(ASN1_STRING_get0_data(akid->keyid), ASN1_STRING_length(akid->keyid), 0);
+		hk = XXH3(ASN1_STRING_get0_data(akid->keyid), ASN1_STRING_length(akid->keyid), 0);
 		for (node = eb64_lookup(&cert_issuer_tree, hk); node; node = eb64_next(node)) {
 			struct issuer_chain *ti = container_of(node, typeof(*issuer), node);
 			if (X509_check_issued(sk_X509_value(ti->chain, 0), cert) == X509_V_OK) {