proxygen
Sha-inl.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 namespace fizz {
12 
13 template <typename T>
15  folly::ByteRange key,
16  const folly::IOBuf& in,
18  CHECK_GE(out.size(), T::HashLen);
19  folly::ssl::OpenSSLHash::hmac(out, T::HashEngine(), key, in);
20 }
21 
22 template <typename T>
24  CHECK_GE(out.size(), T::HashLen);
25  folly::ssl::OpenSSLHash::hash(out, T::HashEngine(), in);
26 }
27 } // namespace fizz
static void hmac(MutableByteRange out, const EVP_MD *md, ByteRange key, ByteRange data)
Definition: OpenSSLHash.h:134
static void hmac(folly::ByteRange key, const folly::IOBuf &in, folly::MutableByteRange out)
Definition: Sha-inl.h:14
constexpr size_type size() const
Definition: Range.h:431
Definition: Actions.h:16
static void hash(const folly::IOBuf &in, folly::MutableByteRange out)
Definition: Sha-inl.h:23
static void hash(MutableByteRange out, const EVP_MD *md, ByteRange data)
Definition: OpenSSLHash.h:76