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