blob: b19c6592ecc172e1f1216b143491302566216070 [file] [log] [blame]
henrike@webrtc.orgf7795df2014-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
8// Ported to C++, Google style and uses basictypes.h
9
10#ifndef WEBRTC_BASE_SHA1_H_
11#define WEBRTC_BASE_SHA1_H_
12
13#include "webrtc/base/basictypes.h"
14
15struct SHA1_CTX {
16 uint32 state[5];
17 // TODO: Change bit count to uint64.
18 uint32 count[2]; // Bit count of input.
19 uint8 buffer[64];
20};
21
22#define SHA1_DIGEST_SIZE 20
23
24void SHA1Init(SHA1_CTX* context);
25void SHA1Update(SHA1_CTX* context, const uint8* data, size_t len);
26void SHA1Final(SHA1_CTX* context, uint8 digest[SHA1_DIGEST_SIZE]);
27
28#endif // WEBRTC_BASE_SHA1_H_