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