pg_conn
[libpgclient.git] / src / md5.h
blob1370387ceef41e685aa266404350f594f5af1497
1 /*********************************************************************
2 * Filename: md5.h
3 * Author: Brad Conte (brad AT bradconte.com)
4 * Copyright:
5 * Disclaimer: This code is presented "as is" without any guarantees.
6 * Details: Defines the API for the corresponding MD5 implementation.
7 *********************************************************************/
9 #ifndef MD5_H
10 #define MD5_H
12 /*************************** HEADER FILES ***************************/
13 #include <stddef.h>
15 /****************************** MACROS ******************************/
16 #define MD5_BLOCK_SIZE 16 // MD5 outputs a 16 byte digest
18 /**************************** DATA TYPES ****************************/
19 typedef unsigned char BYTE; // 8-bit byte
20 typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines
22 typedef struct {
23 BYTE data[64];
24 WORD datalen;
25 unsigned long long bitlen;
26 WORD state[4];
27 } MD5_CTX;
29 /*********************** FUNCTION DECLARATIONS **********************/
30 void md5_init(MD5_CTX *ctx);
31 void md5_update(MD5_CTX *ctx, const BYTE data[], size_t len);
32 void md5_final(MD5_CTX *ctx, BYTE hash[]);
34 #endif // MD5_H