comparison src/sha.h @ 8907:00138e366ef8

[gaim-migrate @ 9677] " Fixes a few warnings on 64bit machines. Also fixes yahoo auth on 64bit machines which would have taken me awhile if marv didn't point me in the right direction. I've applied to my local 32bit copy and everything seems to be working fine." --Gary Kramlich committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 08 May 2004 23:34:30 +0000
parents 0f6673c1ae38
children db62420a53a2
comparison
equal deleted inserted replaced
8906:0d3a68e36132 8907:00138e366ef8
1 #if (SIZEOF_INT == 4) 1 /*
2 typedef unsigned int uint32; 2 * The contents of this file are subject to the Mozilla Public
3 #elif (SIZEOF_SHORT == 4) 3 * License Version 1.1 (the "License"); you may not use this file
4 typedef unsigned short uint32; 4 * except in compliance with the License. You may obtain a copy of
5 #else 5 * the License at http://www.mozilla.org/MPL/
6 typedef unsigned int uint32; 6 *
7 #endif /* HAVEUINT32 */ 7 * Software distributed under the License is distributed on an "AS
8 8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
11 *
12 * The Original Code is SHA 180-1 Reference Implementation (Compact version)
13 *
14 * The Initial Developer of the Original Code is Paul Kocher of
15 * Cryptography Research. Portions created by Paul Kocher are
16 * Copyright (C) 1995-9 by Cryptography Research, Inc. All
17 * Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 */
22 #ifndef _SHA_H_
23 #define _SHA_H_
24
25 #include <glib.h>
26
27 typedef struct {
28 guint32 H[5];
29 guint32 W[80];
30 int lenW;
31 guint32 sizeHi;
32 guint32 sizeLo;
33 } SHA_CTX;
34
9 int strprintsha(char *dest, int *hashval); 35 int strprintsha(char *dest, int *hashval);
10
11 typedef struct {
12 unsigned long H[5];
13 unsigned long W[80];
14 int lenW;
15 unsigned long sizeHi,sizeLo;
16 } SHA_CTX;
17
18 void shaInit(SHA_CTX *ctx); 36 void shaInit(SHA_CTX *ctx);
19 void shaUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len); 37 void shaUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len);
20 void shaFinal(SHA_CTX *ctx, unsigned char hashout[20]); 38 void shaFinal(SHA_CTX *ctx, unsigned char hashout[20]);
21 void shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]); 39 void shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]);
22 40
41 #endif