1999-08-31 09:17:01 +08:00
|
|
|
/* $OpenLDAP$ */
|
1998-12-29 03:51:35 +08:00
|
|
|
/*
|
2002-01-05 04:40:29 +08:00
|
|
|
* Copyright 1998-2002 The OpenLDAP Foundation, Redwood City, California, USA
|
1998-12-29 03:51:35 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2001-05-29 11:29:53 +08:00
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License. A copy of this license is available at
|
|
|
|
* http://www.OpenLDAP.org/license.html or in file LICENSE in the
|
|
|
|
* top-level directory of the distribution.
|
1998-12-29 03:51:35 +08:00
|
|
|
*/
|
|
|
|
|
1998-09-03 05:31:35 +08:00
|
|
|
/* See md5.c for explanation and copyright information. */
|
|
|
|
|
1998-12-01 11:36:37 +08:00
|
|
|
#ifndef _LUTIL_MD5_H_
|
|
|
|
#define _LUTIL_MD5_H_
|
1998-10-25 09:41:42 +08:00
|
|
|
|
1999-11-17 10:04:06 +08:00
|
|
|
#include <lber_types.h>
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
LDAP_BEGIN_DECL
|
1998-09-03 05:31:35 +08:00
|
|
|
|
1999-11-17 10:04:06 +08:00
|
|
|
/* Unlike previous versions of this code, ber_int_t need not be exactly
|
1998-09-03 05:31:35 +08:00
|
|
|
32 bits, merely 32 bits or more. Choosing a data type which is 32
|
|
|
|
bits instead of 64 is not important; speed is considerably more
|
|
|
|
important. ANSI guarantees that "unsigned long" will be big enough,
|
|
|
|
and always using it seems to have few disadvantages. */
|
|
|
|
|
1999-12-08 14:44:22 +08:00
|
|
|
#define LUTIL_MD5_BYTES 16
|
|
|
|
|
1998-12-01 11:36:37 +08:00
|
|
|
struct lutil_MD5Context {
|
1999-11-17 10:04:06 +08:00
|
|
|
ber_uint_t buf[4];
|
|
|
|
ber_uint_t bits[2];
|
1998-09-03 05:31:35 +08:00
|
|
|
unsigned char in[64];
|
|
|
|
};
|
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_LUTIL_F( void )
|
1999-05-19 09:12:33 +08:00
|
|
|
lutil_MD5Init LDAP_P((
|
1998-12-01 11:36:37 +08:00
|
|
|
struct lutil_MD5Context *context));
|
1998-10-25 09:41:42 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_LUTIL_F( void )
|
1999-05-19 09:12:33 +08:00
|
|
|
lutil_MD5Update LDAP_P((
|
1998-12-01 11:36:37 +08:00
|
|
|
struct lutil_MD5Context *context,
|
1998-10-25 09:41:42 +08:00
|
|
|
unsigned char const *buf,
|
1999-11-17 10:04:06 +08:00
|
|
|
ber_len_t len));
|
1998-10-25 09:41:42 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_LUTIL_F( void )
|
1999-05-19 09:12:33 +08:00
|
|
|
lutil_MD5Final LDAP_P((
|
1998-10-25 09:41:42 +08:00
|
|
|
unsigned char digest[16],
|
1998-12-01 11:36:37 +08:00
|
|
|
struct lutil_MD5Context *context));
|
1998-10-25 09:41:42 +08:00
|
|
|
|
2000-06-19 03:48:07 +08:00
|
|
|
LDAP_LUTIL_F( void )
|
1999-05-19 09:12:33 +08:00
|
|
|
lutil_MD5Transform LDAP_P((
|
1999-11-17 10:04:06 +08:00
|
|
|
ber_uint_t buf[4],
|
1998-10-25 09:41:42 +08:00
|
|
|
const unsigned char in[64]));
|
1998-09-03 05:31:35 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* This is needed to make RSAREF happy on some MS-DOS compilers.
|
|
|
|
*/
|
1998-12-01 11:36:37 +08:00
|
|
|
typedef struct lutil_MD5Context lutil_MD5_CTX;
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
LDAP_END_DECL
|
1998-09-03 05:31:35 +08:00
|
|
|
|
1998-12-01 11:36:37 +08:00
|
|
|
#endif /* _LUTIL_MD5_H_ */
|