view src/sha.h @ 10245:c143a3fac58d

[gaim-migrate @ 11385] Binary relocation, step one. I had a fairly long commit message, and cvs ate it and said Read from remote host cvs.sourceforge.net: Connection reset by peer I'm displeased. This is just method one, method two to follow tomorrow after I add a way to register a fallback and try to push it upstream. That way I don't have to put method 2 inside prefix.c. As for as core/ui split goes, they can either each have their own copy after the divorce is final, or the UI can use the core's. It'll work either way, since #1 finds location of the caller, and #2 doesn't work on libraries anyway. That's one advantage I forgot to mention, btw, that #1 will let a library find its own location. So, I'm sure something isn't quite right and someone will want to fix it. So they can fix it while i implement phase two. Which won't take long at all, but the autopackage guy is in bed, and I should be too. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Tue, 23 Nov 2004 05:53:59 +0000
parents db62420a53a2
children
line wrap: on
line source

/* 
 * The contents of this file are subject to the Mozilla Public
 * License Version 1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of
 * the License at http://www.mozilla.org/MPL/
 * 
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 * 
 * The Original Code is SHA 180-1 Reference Implementation (Compact version)
 * 
 * The Initial Developer of the Original Code is Paul Kocher of
 * Cryptography Research.  Portions created by Paul Kocher are 
 * Copyright (C) 1995-9 by Cryptography Research, Inc.  All
 * Rights Reserved.
 * 
 * Contributor(s):
 *
 */
#ifndef _GAIM_SHA_H_
#define _GAIM_SHA_H_

#include <glib.h>

typedef struct {
	guint32 H[5];
 	guint32 W[80];
	int lenW;
	guint32 sizeHi;
	guint32 sizeLo;
} SHA_CTX;

int strprintsha(char *dest, int *hashval);
void shaInit(SHA_CTX *ctx);
void shaUpdate(SHA_CTX *ctx, unsigned char *dataIn, int len);
void shaFinal(SHA_CTX *ctx, unsigned char hashout[20]);
void shaBlock(unsigned char *dataIn, int len, unsigned char hashout[20]);

#endif /* _GAIM_SHA_H_ */