summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/webrtc/rtc_base/sha1.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/libwebrtc/webrtc/rtc_base/sha1.h
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/libwebrtc/webrtc/rtc_base/sha1.h')
-rw-r--r--third_party/libwebrtc/webrtc/rtc_base/sha1.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/third_party/libwebrtc/webrtc/rtc_base/sha1.h b/third_party/libwebrtc/webrtc/rtc_base/sha1.h
new file mode 100644
index 0000000000..f3242b3498
--- /dev/null
+++ b/third_party/libwebrtc/webrtc/rtc_base/sha1.h
@@ -0,0 +1,33 @@
+/*
+ * SHA-1 in C
+ * By Steve Reid <sreid@sea-to-sky.net>
+ * 100% Public Domain
+ *
+*/
+
+// Ported to C++, Google style, under namespace rtc.
+
+#ifndef RTC_BASE_SHA1_H_
+#define RTC_BASE_SHA1_H_
+
+#include <stdint.h>
+#include <stdlib.h>
+
+namespace rtc {
+
+struct SHA1_CTX {
+ uint32_t state[5];
+ // TODO: Change bit count to uint64_t.
+ uint32_t count[2]; // Bit count of input.
+ uint8_t buffer[64];
+};
+
+#define SHA1_DIGEST_SIZE 20
+
+void SHA1Init(SHA1_CTX* context);
+void SHA1Update(SHA1_CTX* context, const uint8_t* data, size_t len);
+void SHA1Final(SHA1_CTX* context, uint8_t digest[SHA1_DIGEST_SIZE]);
+
+} // namespace rtc
+
+#endif // RTC_BASE_SHA1_H_