chromium/third_party/webrtc/rtc_base/message_digest.cc

/*
 *  Copyright 2011 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "rtc_base/message_digest.h"

#include <string.h>

#include <cstdint>
#include <memory>

#include "absl/strings/string_view.h"
#include "rtc_base/openssl_digest.h"
#include "rtc_base/string_encode.h"

namespace rtc {

// From RFC 4572.
const char DIGEST_MD5[] =;
const char DIGEST_SHA_1[] =;
const char DIGEST_SHA_224[] =;
const char DIGEST_SHA_256[] =;
const char DIGEST_SHA_384[] =;
const char DIGEST_SHA_512[] =;

static const size_t kBlockSize =;  // valid for SHA-256 and down

MessageDigest* MessageDigestFactory::Create(absl::string_view alg) {}

bool IsFips180DigestAlgorithm(absl::string_view alg) {}

size_t ComputeDigest(MessageDigest* digest,
                     const void* input,
                     size_t in_len,
                     void* output,
                     size_t out_len) {}

size_t ComputeDigest(absl::string_view alg,
                     const void* input,
                     size_t in_len,
                     void* output,
                     size_t out_len) {}

std::string ComputeDigest(MessageDigest* digest, absl::string_view input) {}

bool ComputeDigest(absl::string_view alg,
                   absl::string_view input,
                   std::string* output) {}

std::string ComputeDigest(absl::string_view alg, absl::string_view input) {}

// Compute a RFC 2104 HMAC: H(K XOR opad, H(K XOR ipad, text))
size_t ComputeHmac(MessageDigest* digest,
                   const void* key,
                   size_t key_len,
                   const void* input,
                   size_t in_len,
                   void* output,
                   size_t out_len) {}

size_t ComputeHmac(absl::string_view alg,
                   const void* key,
                   size_t key_len,
                   const void* input,
                   size_t in_len,
                   void* output,
                   size_t out_len) {}

std::string ComputeHmac(MessageDigest* digest,
                        absl::string_view key,
                        absl::string_view input) {}

bool ComputeHmac(absl::string_view alg,
                 absl::string_view key,
                 absl::string_view input,
                 std::string* output) {}

std::string ComputeHmac(absl::string_view alg,
                        absl::string_view key,
                        absl::string_view input) {}

}  // namespace rtc