~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to libdrizzle-2.0/sha1.h

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
/**
 
4
 * @file
 
5
 * @brief SHA1 Declarations
 
6
 */
 
7
 
 
8
#ifdef  __cplusplus
 
9
extern "C" {
 
10
#endif
 
11
 
 
12
/**
 
13
 * @addtogroup sha1 SHA-1 in C
 
14
 *
 
15
 * Copyright (C) 2010 nobody (this is public domain)
 
16
 *
 
17
 * This file is based on public domain code.
 
18
 * Initial source code is in the public domain, 
 
19
 * so clarified by Steve Reid <steve@edmweb.com>
 
20
 *
 
21
 * @{
 
22
 */
 
23
 
 
24
#define SHA1_BLOCK_LENGTH               64
 
25
#define SHA1_DIGEST_LENGTH              20
 
26
#define SHA1_DIGEST_STRING_LENGTH       (SHA1_DIGEST_LENGTH * 2 + 1)
 
27
 
 
28
typedef struct {
 
29
    uint32_t state[5];
 
30
    uint64_t count;
 
31
    uint8_t buffer[SHA1_BLOCK_LENGTH];
 
32
} SHA1_CTX;
 
33
 
 
34
void SHA1Init(SHA1_CTX *);
 
35
void SHA1Pad(SHA1_CTX *);
 
36
void SHA1Transform(uint32_t [5], const uint8_t [SHA1_BLOCK_LENGTH]);
 
37
void SHA1Update(SHA1_CTX *, const uint8_t *, size_t);
 
38
void SHA1Final(uint8_t [SHA1_DIGEST_LENGTH], SHA1_CTX *);
 
39
 
 
40
/** @} */
 
41
 
 
42
#ifdef  __cplusplus
 
43
}
 
44
#endif