]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/md4.h
Fix include paths for plugins to use the public API of pppd
[ppp.git] / pppd / md4.h
index af7af073b24eddf863000608f0ac091b34b352af..d67daeb820b3982fbaee9aae7cc95fae07b77e60 100644 (file)
@@ -7,46 +7,61 @@
 ** (C) 1990 RSA Data Security, Inc.                                  **
 ** ********************************************************************
 */
+#include "pppdconf.h"
+
+#ifndef __MD4_INCLUDE__
+#define __MD4_INCLUDE__
+#ifndef USE_MD4
+#include <openssl/md4.h>
+#define MD4Init MD4_Init
+#define MD4Update MD4_Update
+#define MD4Final MD4_Final
+#else
 
 /* MDstruct is the data structure for a message digest computation.
 */
 typedef struct {
-unsigned int buffer[4]; /* Holds 4-word result of MD computation */
-unsigned char count[8]; /* Number of bits processed so far */
-unsigned int done;      /* Nonzero means MD computation finished */
-} MDstruct, *MDptr;
-
-/* MDbegin(MD)
-** Input: MD -- an MDptr
-** Initialize the MDstruct prepatory to doing a message digest
+       unsigned int buffer[4]; /* Holds 4-word result of MD computation */
+       unsigned char count[8]; /* Number of bits processed so far */
+       unsigned int done;      /* Nonzero means MD computation finished */
+} MD4_CTX;
+
+/* MD4Init(MD4_CTX *)
+** Initialize the MD4_CTX prepatory to doing a message digest
 ** computation.
 */
-extern void MDbegin();
+extern void MD4Init(MD4_CTX *MD);
 
-/* MDupdate(MD,X,count)
-** Input: MD -- an MDptr
-**        X -- a pointer to an array of unsigned characters.
+/* MD4Update(MD,X,count)
+** Input: X -- a pointer to an array of unsigned characters.
 **        count -- the number of bits of X to use (an unsigned int).
 ** Updates MD using the first "count" bits of X.
 ** The array pointed to by X is not modified.
-** If count is not a multiple of 8, MDupdate uses high bits of
+** If count is not a multiple of 8, MD4Update uses high bits of
 ** last byte.
 ** This is the basic input routine for a user.
 ** The routine terminates the MD computation when count < 512, so
-** every MD computation should end with one call to MDupdate with a
+** every MD computation should end with one call to MD4Update with a
 ** count less than 512.  Zero is OK for a count.
 */
-extern void MDupdate();
+extern void MD4Update(MD4_CTX *MD, unsigned char *X, unsigned int count);
 
-/* MDprint(MD)
-** Input: MD -- an MDptr
+/* MD4Print(MD)
 ** Prints message digest buffer MD as 32 hexadecimal digits.
 ** Order is from low-order byte of buffer[0] to high-order byte
 ** of buffer[3].
 ** Each byte is printed with high-order hexadecimal digit first.
 */
-extern void MDprint();
+extern void MD4Print(MD4_CTX *);
+
+/* MD4Final(buf, MD)
+** Returns message digest from MD and terminates the message
+** digest computation.
+*/
+extern void MD4Final(unsigned char *, MD4_CTX *);
 
 /*
 ** End of md4.h
 ****************************(cut)***********************************/
+#endif  /* USE_MD4 */
+#endif  /* __MD4_INCLUDE__ */