blob: 4862a00498a3f6fbfdb65a67af7a2b402075dc61 [file] [log] [blame]
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00001/*
2 * SHA-1 in C
3 * By Steve Reid <sreid@sea-to-sky.net>
4 * 100% Public Domain
5 *
6*/
7
henrike@webrtc.orgc50bf7c2014-05-14 18:24:13 +00008// Ported to C++, Google style, under namespace rtc and uses basictypes.h
henrike@webrtc.orgf0488722014-05-13 18:00:26 +00009
10#ifndef WEBRTC_BASE_SHA1_H_
11#define WEBRTC_BASE_SHA1_H_
12
13#include "webrtc/base/basictypes.h"
14
henrike@webrtc.orgc50bf7c2014-05-14 18:24:13 +000015namespace rtc {
16
henrike@webrtc.orgf0488722014-05-13 18:00:26 +000017struct SHA1_CTX {
18 uint32 state[5];
19 // TODO: Change bit count to uint64.
20 uint32 count[2]; // Bit count of input.
21 uint8 buffer[64];
22};
23
24#define SHA1_DIGEST_SIZE 20
25
26void SHA1Init(SHA1_CTX* context);
27void SHA1Update(SHA1_CTX* context, const uint8* data, size_t len);
28void SHA1Final(SHA1_CTX* context, uint8 digest[SHA1_DIGEST_SIZE]);
29
30#endif // WEBRTC_BASE_SHA1_H_
henrike@webrtc.orgc50bf7c2014-05-14 18:24:13 +000031
32} // namespace rtc