1
/* Copyright (C) 2002, 2006 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
This is the header file for code which implements the Secure
18
Hashing Algorithm 1 as defined in FIPS PUB 180-1 published
21
Many of the variable names in this code, especially the
22
single character names, were used because those were the names
23
used in the publication.
25
Please read the file sha1.c for more information.
27
Modified 2002 by Peter Zaitsev to better follow MySQL standards
34
SHA_NULL, /* Null pointer parameter */
35
SHA_INPUT_TOO_LONG, /* input data too long */
36
SHA_STATE_ERROR /* called Input after Result */
39
#define SHA1_HASH_SIZE 20 /* Hash size in bytes */
42
This structure will hold context information for the SHA-1
46
typedef struct SHA1_CONTEXT
48
ulonglong Length; /* Message length in bits */
49
uint32 Intermediate_Hash[SHA1_HASH_SIZE/4]; /* Message Digest */
50
int Computed; /* Is the digest computed? */
51
int Corrupted; /* Is the message digest corrupted? */
52
int16 Message_Block_Index; /* Index into message block array */
53
uint8 Message_Block[64]; /* 512-bit message blocks */
62
int mysql_sha1_reset(SHA1_CONTEXT*);
63
int mysql_sha1_input(SHA1_CONTEXT*, const uint8 *, unsigned int);
64
int mysql_sha1_result(SHA1_CONTEXT* , uint8 Message_Digest[SHA1_HASH_SIZE]);