Add macaroone implementation from
https://weave.googlesource.com/weave/libuweave
BUG:25934771
Change-Id: Iba87e709a51006f3e966b9942a375d1c31b2f17d
Reviewed-on: https://weave-review.googlesource.com/1804
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/third_party/libuweave/src/crypto_utils.h b/third_party/libuweave/src/crypto_utils.h
new file mode 100644
index 0000000..54bfcae
--- /dev/null
+++ b/third_party/libuweave/src/crypto_utils.h
@@ -0,0 +1,22 @@
+// Copyright 2015 The Weave Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef LIBUWEAVE_SRC_CRYPTO_UTILS_H_
+#define LIBUWEAVE_SRC_CRYPTO_UTILS_H_
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+
+/**
+ * Check if two byte arrays are the same in constant time (the running time
+ * should only depend on the length of the given arrays). It's critical to use
+ * constant-time methods to compare secret data. Timing information can lead to
+ * full recovery of the secret data.
+ */
+bool uw_crypto_utils_equal_(const uint8_t* arr1,
+ const uint8_t* arr2,
+ size_t len);
+
+#endif // LIBUWEAVE_SRC_CRYPTO_UTILS_H_