proxygen
fizz::Sha< T > Struct Template Reference

#include <Sha.h>

Static Public Member Functions

static void hmac (folly::ByteRange key, const folly::IOBuf &in, folly::MutableByteRange out)
 
static void hash (const folly::IOBuf &in, folly::MutableByteRange out)
 

Detailed Description

template<typename T>
struct fizz::Sha< T >

Hash implementation using OpenSSL.

The template struct requires the following parameters:

  • HashLen: length of the hash digest
  • HashEngine: function returning EVP_MD* to use
  • BlankHash: ByteRange containing the digest of a hash of empty input

Definition at line 26 of file Sha.h.

Member Function Documentation

template<typename T >
void fizz::Sha< T >::hash ( const folly::IOBuf in,
folly::MutableByteRange  out 
)
static

Puts Hash(in) into out. Out must be at least of size HashLen.

Definition at line 23 of file Sha-inl.h.

References folly::ssl::OpenSSLHash::hash(), and folly::Range< Iter >::size().

23  {
24  CHECK_GE(out.size(), T::HashLen);
25  folly::ssl::OpenSSLHash::hash(out, T::HashEngine(), in);
26 }
constexpr size_type size() const
Definition: Range.h:431
static void hash(MutableByteRange out, const EVP_MD *md, ByteRange data)
Definition: OpenSSLHash.h:76
template<typename T >
void fizz::Sha< T >::hmac ( folly::ByteRange  key,
const folly::IOBuf in,
folly::MutableByteRange  out 
)
static

Puts HMAC(key, in) into out. Out must be at least of size HashLen.

Definition at line 14 of file Sha-inl.h.

References folly::ssl::OpenSSLHash::hmac(), and folly::Range< Iter >::size().

17  {
18  CHECK_GE(out.size(), T::HashLen);
19  folly::ssl::OpenSSLHash::hmac(out, T::HashEngine(), key, in);
20 }
static void hmac(MutableByteRange out, const EVP_MD *md, ByteRange key, ByteRange data)
Definition: OpenSSLHash.h:134
constexpr size_type size() const
Definition: Range.h:431

The documentation for this struct was generated from the following files: