2
* Copyright (C) 2010 nobody (this is public domain)
7
* @brief SHA1 Declarations
10
#ifndef DRIZZLED_ALGORITHM_SHA1_H
11
#define DRIZZLED_ALGORITHM_SHA1_H
14
#include <sys/types.h>
21
* @addtogroup sha1 SHA-1 in C
23
* This file is based on public domain code.
24
* Initial source code is in the public domain,
25
* so clarified by Steve Reid <steve@edmweb.com>
30
#define SHA1_BLOCK_LENGTH 64
31
#define SHA1_DIGEST_LENGTH 20
32
#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)
34
typedef class sha1_ctx{
38
uint8_t buffer[SHA1_BLOCK_LENGTH];
44
memset(buffer, 0, SHA1_BLOCK_LENGTH);
48
void SHA1Init(SHA1_CTX *);
49
void SHA1Pad(SHA1_CTX *);
50
void SHA1Transform(uint32_t [5], const uint8_t [SHA1_BLOCK_LENGTH]);
51
void SHA1Update(SHA1_CTX *, const uint8_t *, size_t);
52
void SHA1Final(uint8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *);
56
} /* namespace drizzled */
58
#endif /* DRIZZLED_ALGORITHM_SHA1_H */