summaryrefslogtreecommitdiff
path: root/chromium/third_party/libjingle/source/talk/base/sha1.h
blob: 262b744cd5c9c1abbdf9a29b036144f639b369c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * SHA-1 in C
 * By Steve Reid <sreid@sea-to-sky.net>
 * 100% Public Domain
 *
*/

// Ported to C++, Google style and uses basictypes.h

#ifndef TALK_BASE_SHA1_H_
#define TALK_BASE_SHA1_H_

#include "talk/base/basictypes.h"

struct SHA1_CTX {
  uint32 state[5];
  // TODO: Change bit count to uint64.
  uint32 count[2];  // Bit count of input.
  uint8 buffer[64];
};

#define SHA1_DIGEST_SIZE 20

void SHA1Init(SHA1_CTX* context);
void SHA1Update(SHA1_CTX* context, const uint8* data, size_t len);
void SHA1Final(SHA1_CTX* context, uint8 digest[SHA1_DIGEST_SIZE]);

#endif  // TALK_BASE_SHA1_H_