1 /** 2 * @file sha1.h 3 * 4 * @brief header file for sha.c 5 * 6 * Original code: Copyright (C) 2001-2003 Christophe Devine 7 * 8 * 2004-10-08 Alejandro Claro <aleo@apollyon.no-ip.com> 9 * - Variables types adapted to Glib types for compatibilities reasons. 10 * - SHA1 function, compute sha1 of a memory block using just 1 function. 11 * - R, S and P macros moved outside sha1_process function. 12 * - SHA_DIGEST_LENGTH defined and sustituted where needed. 13 * 14 * Fri Oct 8 20:25:48 2004 15 * Copyright (C) 2004 Alejandro Claro 16 * aleo@apollyon.no-ip.com 17 */ 18 19 #ifndef _SHA1_H 20 #define _SHA1_H 21 22 #define SHA_DIGEST_LENGTH 20 23 24 typedef struct 25 { 26 guint32 total[2]; 27 guint32 state[5]; 28 guint8 buffer[64]; 29 } sha1_context; 30 31 G_BEGIN_DECLS 32 33 void sha1_starts(sha1_context *ctx); 34 void sha1_update(sha1_context *ctx, guint8 *input, guint32 length); 35 void sha1_finish(sha1_context *ctx, guint8 digest[20]); 36 37 guint8 *SHA1(guint8 *input, guint32 length, guint8 *digest); 38 39 G_END_DECLS 40 41 #endif /* _SHA1_H */ 42