~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/util/sha1.h

  • Committer: Eric Day
  • Date: 2010-03-18 01:07:53 UTC
  • mto: (1337.4.7)
  • mto: This revision was merged to the branch mainline in revision 1409.
  • Revision ID: eday@oddments.org-20100318010753-ej6j2nmngfkxpo7f
Added MYSQL_PASSWORD() UDF.

Show diffs side-by-side

added added

removed removed

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