~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/algorithm/sha1.h

  • Committer: lbieber at stabletransit
  • Date: 2010-10-14 15:43:11 UTC
  • mfrom: (1848.1.4 build)
  • Revision ID: lbieber@drizzle-build-n02.wc1.dfw1.stabletransit.com-20101014154311-ojsrl9uz80yvizey
Merge Travis - changing struct to C++ classes
Merge Andrew - fix bug #571579: libdrizzle unexpected hang up when using in extremely slow networking environment
Merge Andrew - fix bug #643772: Large rows cannot be read if packet_size exceeds max buffer size
Merge Andrew - fix bug #660082: libdrizzle missing rev.147
Merge Andrew - fix bug 653234: drizzledump (and other clients?) should print Password: prompt on stderr
Merge Andrew - fix bug #653438: "Enter password" prompt should not print stars, or erase them on enter
Merge Andrew - fix bug 659824: Drizzle client UTF8 processing endless loop

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
#include <stdint.h>
14
14
#include <sys/types.h>
 
15
#include <string.h>
15
16
 
16
17
namespace drizzled
17
18
{
27
28
#define SHA1_DIGEST_LENGTH              20
28
29
#define SHA1_DIGEST_STRING_LENGTH       (SHA1_DIGEST_LENGTH * 2 + 1)
29
30
 
30
 
typedef struct {
 
31
typedef class sha1_ctx{
 
32
public:
31
33
    uint32_t state[5];
32
34
    uint64_t count;
33
35
    uint8_t buffer[SHA1_BLOCK_LENGTH];
 
36
 
 
37
    sha1_ctx():
 
38
        count(0)
 
39
    {
 
40
      memset(state, 0, 5);
 
41
      memset(buffer, 0, SHA1_BLOCK_LENGTH);
 
42
    }
34
43
} SHA1_CTX;
35
44
 
36
45
void SHA1Init(SHA1_CTX *);