Home | History | Annotate | Download | only in src
      1 // Copyright 2015 The Weave Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef LIBUWEAVE_SRC_CRYPTO_UTILS_H_
      6 #define LIBUWEAVE_SRC_CRYPTO_UTILS_H_
      7 
      8 #include <stdbool.h>
      9 #include <stddef.h>
     10 #include <stdint.h>
     11 
     12 /**
     13  * Check if two byte arrays are the same in constant time (the running time
     14  * should only depend on the length of the given arrays). It's critical to use
     15  * constant-time methods to compare secret data. Timing information can lead to
     16  * full recovery of the secret data.
     17  */
     18 bool uw_crypto_utils_equal_(const uint8_t* arr1,
     19                             const uint8_t* arr2,
     20                             size_t len);
     21 
     22 #endif  // LIBUWEAVE_SRC_CRYPTO_UTILS_H_
     23