| // Copyright 2014 The Chromium OS Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| #include "libweave/src/privet/openssl_utils.h" |
| #include <openssl/hmac.h> |
| #include <base/logging.h> |
| std::vector<uint8_t> HmacSha256(const std::vector<uint8_t>& key, |
| const std::vector<uint8_t>& data) { |
| std::vector<uint8_t> mac(kSha256OutputSize); |
| CHECK(HMAC(EVP_sha256(), key.data(), key.size(), data.data(), data.size(), |
| CHECK_EQ(len, kSha256OutputSize); |