summaryrefslogtreecommitdiff
path: root/llvm/lib/Support/SHA1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/SHA1.cpp')
-rw-r--r--llvm/lib/Support/SHA1.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Support/SHA1.cpp b/llvm/lib/Support/SHA1.cpp
index a98ca41a33545..417b13fea05a4 100644
--- a/llvm/lib/Support/SHA1.cpp
+++ b/llvm/lib/Support/SHA1.cpp
@@ -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)