xref: /freebsd/crypto/krb5/src/lib/crypto/builtin/md4/rsa-md4.h (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 /* lib/crypto/builtin/md4/rsa-md4.h */
3 /*
4  * Copyright 1991 by the Massachusetts Institute of Technology.
5  * All Rights Reserved.
6  *
7  * Export of this software from the United States of America may
8  *   require a specific license from the United States Government.
9  *   It is the responsibility of any person or organization contemplating
10  *   export to obtain such a license before exporting.
11  *
12  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13  * distribute this software and its documentation for any purpose and
14  * without fee is hereby granted, provided that the above copyright
15  * notice appear in all copies and that both that copyright notice and
16  * this permission notice appear in supporting documentation, and that
17  * the name of M.I.T. not be used in advertising or publicity pertaining
18  * to distribution of the software without specific, written prior
19  * permission.  Furthermore if you modify this software you must label
20  * your software as modified software and not distribute it in such a
21  * fashion that it might be confused with the original M.I.T. software.
22  * M.I.T. makes no representations about the suitability of
23  * this software for any purpose.  It is provided "as is" without express
24  * or implied warranty.
25  */
26 /*
27  * Copyright (C) 1990, RSA Data Security, Inc. All rights reserved.
28  *
29  * License to copy and use this software is granted provided that
30  * it is identified as the "RSA Data Security, Inc. MD4 Message
31  * Digest Algorithm" in all material mentioning or referencing this
32  * software or this function.
33  *
34  * License is also granted to make and use derivative works
35  * provided that such works are identified as "derived from the RSA
36  * Data Security, Inc. MD4 Message Digest Algorithm" in all
37  * material mentioning or referencing the derived work.
38  *
39  * RSA Data Security, Inc. makes no representations concerning
40  * either the merchantability of this software or the suitability
41  * of this software for any particular purpose.  It is provided "as
42  * is" without express or implied warranty of any kind.
43  *
44  * These notices must be retained in any copies of any part of this
45  * documentation and/or software.
46  */
47 
48 /* RSA MD4 header file, with Kerberos/STDC additions. */
49 
50 #ifndef __KRB5_RSA_MD4_H__
51 #define __KRB5_RSA_MD4_H__
52 
53 #ifdef unicos61
54 #include <sys/types.h>
55 #endif /* unicos61 */
56 
57 /* 16 u_char's in the digest */
58 #define RSA_MD4_CKSUM_LENGTH    16
59 /* des blocksize is 8, so this works nicely... */
60 #define OLD_RSA_MD4_DES_CKSUM_LENGTH    16
61 #define NEW_RSA_MD4_DES_CKSUM_LENGTH    24
62 #define RSA_MD4_DES_CONFOUND_LENGTH     8
63 
64 /*
65 **********************************************************************
66 ** md4.h -- Header file for implementation of MD4                   **
67 ** RSA Data Security, Inc. MD4 Message Digest Algorithm             **
68 ** Created: 2/17/90 RLR                                             **
69 ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version              **
70 **********************************************************************
71 */
72 
73 /* Data structure for MD4 (Message Digest) computation */
74 typedef struct {
75     krb5_ui_4 i[2];                       /* number of _bits_ handled mod 2^64 */
76     krb5_ui_4 buf[4];                     /* scratch buffer */
77     unsigned char in[64];                 /* input buffer */
78     unsigned char digest[16];             /* actual digest after MD4Final call */
79 } krb5_MD4_CTX;
80 
81 extern void krb5int_MD4Init(krb5_MD4_CTX *);
82 extern void krb5int_MD4Update(krb5_MD4_CTX *, const unsigned char *, unsigned int);
83 extern void krb5int_MD4Final(krb5_MD4_CTX *);
84 
85 /*
86 **********************************************************************
87 ** End of md4.h                                                     **
88 ******************************* (cut) ********************************
89 */
90 #endif /* __KRB5_RSA_MD4_H__ */
91