xref: /illumos-gate/usr/src/uts/common/gssapi/mechs/krb5/include/dk.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1 
2 #pragma ident	"%Z%%M%	%I%	%E% SMI"
3 
4 /*
5  * Copyright (C) 1998 by the FundsXpress, INC.
6  *
7  * All rights reserved.
8  *
9  * Export of this software from the United States of America may require
10  * a specific license from the United States Government.  It is the
11  * responsibility of any person or organization contemplating export to
12  * obtain such a license before exporting.
13  *
14  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
15  * distribute this software and its documentation for any purpose and
16  * without fee is hereby granted, provided that the above copyright
17  * notice appear in all copies and that both that copyright notice and
18  * this permission notice appear in supporting documentation, and that
19  * the name of FundsXpress. not be used in advertising or publicity pertaining
20  * to distribution of the software without specific, written prior
21  * permission.  FundsXpress makes no representations about the suitability of
22  * this software for any purpose.  It is provided "as is" without express
23  * or implied warranty.
24  *
25  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
26  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
27  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
28  */
29 
30 #ifndef _KRB5_DK_
31 #define _KRB5_DK_
32 
33 #include <k5-int.h>
34 
35 extern void krb5_dk_encrypt_length
36 (krb5_const struct krb5_enc_provider *enc,
37 	krb5_const struct krb5_hash_provider *hash,
38 	size_t input, size_t *length);
39 
40 extern krb5_error_code krb5_dk_encrypt
41 (
42 	krb5_context context,
43 	krb5_const struct krb5_enc_provider *enc,
44 	krb5_const struct krb5_hash_provider *hash,
45 	krb5_const krb5_keyblock *key, krb5_keyusage usage,
46 	krb5_const krb5_data *ivec,
47 	krb5_const krb5_data *input, krb5_data *output);
48 
49 extern krb5_error_code krb5_dk_decrypt
50 (krb5_context context,
51 	krb5_const struct krb5_enc_provider *enc,
52 	krb5_const struct krb5_hash_provider *hash,
53 	krb5_const krb5_keyblock *key, krb5_keyusage usage,
54 	krb5_const krb5_data *ivec, krb5_const krb5_data *input,
55 	krb5_data *arg_output);
56 
57 extern krb5_error_code krb5_derive_key
58 (krb5_context context,
59 	krb5_const struct krb5_enc_provider *enc,
60 	krb5_const krb5_keyblock *inkey,
61 	krb5_keyblock *outkey, krb5_const krb5_data *in_constant);
62 
63 extern krb5_error_code krb5_dk_make_checksum
64 (krb5_context context,
65 	krb5_const struct krb5_hash_provider *hash,
66 	krb5_const krb5_keyblock *key, krb5_keyusage usage,
67 	krb5_const krb5_data *input, krb5_data *output);
68 
69 
70 #ifndef _KERNEL
71 extern krb5_error_code krb5_dk_string_to_key
72 (krb5_context context,
73 	krb5_const struct krb5_enc_provider *enc,
74 	krb5_const krb5_data *string,
75 	krb5_const krb5_data *salt,
76 	krb5_const krb5_data *params,
77 	krb5_keyblock *key);
78 #endif
79 
80 void krb5int_aes_encrypt_length
81 (		const struct krb5_enc_provider *enc,
82 		const struct krb5_hash_provider *hash,
83 		size_t input, size_t *length);
84 
85 krb5_error_code krb5int_aes_dk_encrypt
86 (		krb5_context context,
87 		const struct krb5_enc_provider *enc,
88 		const struct krb5_hash_provider *hash,
89 		const krb5_keyblock *key, krb5_keyusage usage,
90 		const krb5_data *ivec,
91 		const krb5_data *input, krb5_data *output);
92 
93 krb5_error_code krb5int_aes_dk_decrypt
94 (		krb5_context context,
95 		const struct krb5_enc_provider *enc,
96 		const struct krb5_hash_provider *hash,
97 		const krb5_keyblock *key, krb5_keyusage usage,
98 		const krb5_data *ivec, const krb5_data *input,
99 		krb5_data *arg_output);
100 
101 extern krb5_error_code
102 krb5int_aes_string_to_key (krb5_context context,
103 			const struct krb5_enc_provider *,
104                            const krb5_data *, const krb5_data *,
105                            const krb5_data *, krb5_keyblock *key);
106 
107 
108 
109 #endif /* _KRB5_DK_ */
110 
111