1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

SHA1.h - remove unnecessary ArrayRef.h/StringRef.h includes. NFC.

By moving the update(StringRef) wrapper into SHA1.cpp we can depend just on system headers.
This commit is contained in:
Simon Pilgrim 2020-04-21 15:12:05 +01:00
parent e99abe0a68
commit 4bf9b69a3f
2 changed files with 10 additions and 10 deletions

View File

@ -15,14 +15,12 @@
#ifndef LLVM_SUPPORT_SHA1_H
#define LLVM_SUPPORT_SHA1_H
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include <array>
#include <cstdint>
namespace llvm {
template <typename T> class ArrayRef;
class StringRef;
/// A class that wrap the SHA1 algorithm.
class SHA1 {
@ -36,10 +34,7 @@ public:
void update(ArrayRef<uint8_t> Data);
/// Digest more data.
void update(StringRef Str) {
update(ArrayRef<uint8_t>((uint8_t *)const_cast<char *>(Str.data()),
Str.size()));
}
void update(StringRef Str);
/// Return a reference to the current raw 160-bits SHA1 for the digested data
/// since the last call to init(). This call will add data to the internal

View File

@ -16,13 +16,13 @@
#include "llvm/Support/SHA1.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Host.h"
using namespace llvm;
#include <stdint.h>
#include <string.h>
using namespace llvm;
#if defined(BYTE_ORDER) && defined(BIG_ENDIAN) && BYTE_ORDER == BIG_ENDIAN
#define SHA_BIG_ENDIAN
#endif
@ -238,6 +238,11 @@ void SHA1::update(ArrayRef<uint8_t> Data) {
addUncounted(C);
}
void SHA1::update(StringRef Str) {
update(
ArrayRef<uint8_t>((uint8_t *)const_cast<char *>(Str.data()), Str.size()));
}
void SHA1::pad() {
// Implement SHA-1 padding (fips180-2 5.1.1)