// 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. #include "src/privet/openssl_utils.h" #include #include extern "C" { #include "third_party/libuweave/src/crypto_hmac.h" } namespace weave { namespace privet { std::vector HmacSha256(const std::vector& key, const std::vector& data) { std::vector mac(kSha256OutputSize); const UwCryptoHmacMsg messages[] = {{data.data(), data.size()}}; CHECK(uw_crypto_hmac_(key.data(), key.size(), messages, arraysize(messages), mac.data(), mac.size())); return mac; } } // namespace privet } // namespace weave