~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/algorithm/sha1.h

  • Committer: Stewart Smith
  • Date: 2010-03-15 04:42:26 UTC
  • mto: (1283.38.1)
  • mto: This revision was merged to the branch mainline in revision 1475.
  • Revision ID: stewart@flamingspork.com-20100315044226-q74o953r9h98brm4
basic embedded innodb DATA_DICTIONARY.INNODB_CONFIGURATION test

Show diffs side-by-side

added added

removed removed

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