~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/sha1.h

  • Committer: Monty Taylor
  • Date: 2010-08-12 20:27:32 UTC
  • mto: (1720.1.5 build)
  • mto: This revision was merged to the branch mainline in revision 1722.
  • Revision ID: mordred@inaugust.com-20100812202732-9kzchbkvkyki4n3u
Merged libdrizzle directly into tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * @file
 
3
 * @brief SHA1 Declarations
 
4
 */
 
5
 
 
6
#ifndef _SHA1_H
 
7
#define _SHA1_H
 
8
 
 
9
#ifdef  __cplusplus
 
10
extern "C" {
 
11
#endif
 
12
 
 
13
/**
 
14
 * @addtogroup sha1 SHA-1 in C
 
15
 * By Steve Reid <steve@edmweb.com>
 
16
 * 100% Public Domain
 
17
 * @{
 
18
 */
 
19
 
 
20
#define SHA1_BLOCK_LENGTH               64
 
21
#define SHA1_DIGEST_LENGTH              20
 
22
#define SHA1_DIGEST_STRING_LENGTH       (SHA1_DIGEST_LENGTH * 2 + 1)
 
23
 
 
24
typedef struct {
 
25
    uint32_t state[5];
 
26
    uint64_t count;
 
27
    uint8_t buffer[SHA1_BLOCK_LENGTH];
 
28
} SHA1_CTX;
 
29
 
 
30
void SHA1Init(SHA1_CTX *);
 
31
void SHA1Pad(SHA1_CTX *);
 
32
void SHA1Transform(uint32_t [5], const uint8_t [SHA1_BLOCK_LENGTH]);
 
33
void SHA1Update(SHA1_CTX *, const uint8_t *, size_t);
 
34
void SHA1Final(uint8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *);
 
35
 
 
36
/** @} */
 
37
 
 
38
#ifdef  __cplusplus
 
39
}
 
40
#endif
 
41
 
 
42
#endif /* _SHA1_H */