Home | History | Annotate | Line # | Download | only in include
      1 /*	$NetBSD: md2.h,v 1.9 2024/01/19 18:40:35 christos Exp $	*/
      2 
      3 #ifndef _MD2_H_
      4 #define _MD2_H_
      5 
      6 #include <sys/cdefs.h>
      7 #include <sys/types.h>
      8 
      9 #define	MD2_DIGEST_LENGTH		16
     10 #define	MD2_DIGEST_STRING_LENGTH	33
     11 #define	MD2_BLOCK_LENGTH		16
     12 
     13 /* MD2 context. */
     14 typedef struct MD2Context {
     15 	uint32_t i;
     16 	unsigned char C[16];		/* checksum */
     17 	unsigned char X[48];		/* input buffer */
     18 } MD2_CTX;
     19 
     20 __BEGIN_DECLS
     21 void	MD2Init(MD2_CTX *);
     22 void	MD2Update(MD2_CTX *, const unsigned char *, unsigned int);
     23 void	MD2Final(unsigned char[16], MD2_CTX *);
     24 char	*MD2End(MD2_CTX *, char[MD2_DIGEST_STRING_LENGTH]);
     25 char	*MD2File(const char *, char *);
     26 char	*MD2FileChunk(const char *, char *, off_t, off_t);
     27 char	*MD2Data(const unsigned char *, size_t, char[MD2_DIGEST_STRING_LENGTH]);
     28 #ifdef _LIBC_INTERNAL
     29 void	MD2Transform(MD2_CTX *);
     30 #endif
     31 __END_DECLS
     32 
     33 #endif /* _MD2_H_ */
     34