xref: /illumos-gate/usr/src/uts/common/sys/crypto/ioctl.h (revision 4a5b2e70a1a587f05589329302db05d4166477dd)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5f317a3a3Skrishna  * Common Development and Distribution License (the "License").
6f317a3a3Skrishna  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21ba5f469cSkrishna 
227c478bd9Sstevel@tonic-gate /*
23ba5f469cSkrishna  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_CRYPTO_IOCTL_H
287c478bd9Sstevel@tonic-gate #define	_SYS_CRYPTO_IOCTL_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #include <sys/types.h>
377c478bd9Sstevel@tonic-gate #include <sys/crypto/spi.h>
387c478bd9Sstevel@tonic-gate #include <sys/crypto/common.h>
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #define	CRYPTO_MAX_ATTRIBUTE_COUNT	128
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #define	CRYPTO_IOFLAGS_RW_SESSION	0x00000001
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #define	CRYPTO(x)		(('y' << 8) | (x))
457c478bd9Sstevel@tonic-gate 
46*4a5b2e70Shaimay #define	MAX_NUM_THRESHOLD	7
47*4a5b2e70Shaimay 
48*4a5b2e70Shaimay /* the PKCS11 Mechanisms */
49*4a5b2e70Shaimay #define	CKM_RC4			0x00000111
50*4a5b2e70Shaimay #define	CKM_DES3_ECB		0x00000132
51*4a5b2e70Shaimay #define	CKM_DES3_CBC		0x00000133
52*4a5b2e70Shaimay #define	CKM_MD5			0x00000210
53*4a5b2e70Shaimay #define	CKM_SHA_1		0x00000220
54*4a5b2e70Shaimay #define	CKM_AES_ECB		0x00001081
55*4a5b2e70Shaimay #define	CKM_AES_CBC		0x00001082
56*4a5b2e70Shaimay 
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * General Purpose Ioctls
597c478bd9Sstevel@tonic-gate  */
607c478bd9Sstevel@tonic-gate 
61*4a5b2e70Shaimay typedef struct fl_mechs_threshold {
62*4a5b2e70Shaimay 	int		mech_type;
63*4a5b2e70Shaimay 	uint32_t	mech_threshold;
64*4a5b2e70Shaimay } fl_mechs_threshold_t;
65*4a5b2e70Shaimay 
667c478bd9Sstevel@tonic-gate typedef struct crypto_function_list {
677c478bd9Sstevel@tonic-gate 	boolean_t fl_digest_init;
687c478bd9Sstevel@tonic-gate 	boolean_t fl_digest;
697c478bd9Sstevel@tonic-gate 	boolean_t fl_digest_update;
707c478bd9Sstevel@tonic-gate 	boolean_t fl_digest_key;
717c478bd9Sstevel@tonic-gate 	boolean_t fl_digest_final;
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate 	boolean_t fl_encrypt_init;
747c478bd9Sstevel@tonic-gate 	boolean_t fl_encrypt;
757c478bd9Sstevel@tonic-gate 	boolean_t fl_encrypt_update;
767c478bd9Sstevel@tonic-gate 	boolean_t fl_encrypt_final;
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt_init;
797c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt;
807c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt_update;
817c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt_final;
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate 	boolean_t fl_mac_init;
847c478bd9Sstevel@tonic-gate 	boolean_t fl_mac;
857c478bd9Sstevel@tonic-gate 	boolean_t fl_mac_update;
867c478bd9Sstevel@tonic-gate 	boolean_t fl_mac_final;
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_init;
897c478bd9Sstevel@tonic-gate 	boolean_t fl_sign;
907c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_update;
917c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_final;
927c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_recover_init;
937c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_recover;
947c478bd9Sstevel@tonic-gate 
957c478bd9Sstevel@tonic-gate 	boolean_t fl_verify_init;
967c478bd9Sstevel@tonic-gate 	boolean_t fl_verify;
977c478bd9Sstevel@tonic-gate 	boolean_t fl_verify_update;
987c478bd9Sstevel@tonic-gate 	boolean_t fl_verify_final;
997c478bd9Sstevel@tonic-gate 	boolean_t fl_verify_recover_init;
1007c478bd9Sstevel@tonic-gate 	boolean_t fl_verify_recover;
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate 	boolean_t fl_digest_encrypt_update;
1037c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt_digest_update;
1047c478bd9Sstevel@tonic-gate 	boolean_t fl_sign_encrypt_update;
1057c478bd9Sstevel@tonic-gate 	boolean_t fl_decrypt_verify_update;
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate 	boolean_t fl_seed_random;
1087c478bd9Sstevel@tonic-gate 	boolean_t fl_generate_random;
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate 	boolean_t fl_session_open;
1117c478bd9Sstevel@tonic-gate 	boolean_t fl_session_close;
1127c478bd9Sstevel@tonic-gate 	boolean_t fl_session_login;
1137c478bd9Sstevel@tonic-gate 	boolean_t fl_session_logout;
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate 	boolean_t fl_object_create;
1167c478bd9Sstevel@tonic-gate 	boolean_t fl_object_copy;
1177c478bd9Sstevel@tonic-gate 	boolean_t fl_object_destroy;
1187c478bd9Sstevel@tonic-gate 	boolean_t fl_object_get_size;
1197c478bd9Sstevel@tonic-gate 	boolean_t fl_object_get_attribute_value;
1207c478bd9Sstevel@tonic-gate 	boolean_t fl_object_set_attribute_value;
1217c478bd9Sstevel@tonic-gate 	boolean_t fl_object_find_init;
1227c478bd9Sstevel@tonic-gate 	boolean_t fl_object_find;
1237c478bd9Sstevel@tonic-gate 	boolean_t fl_object_find_final;
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate 	boolean_t fl_key_generate;
1267c478bd9Sstevel@tonic-gate 	boolean_t fl_key_generate_pair;
1277c478bd9Sstevel@tonic-gate 	boolean_t fl_key_wrap;
1287c478bd9Sstevel@tonic-gate 	boolean_t fl_key_unwrap;
1297c478bd9Sstevel@tonic-gate 	boolean_t fl_key_derive;
1307c478bd9Sstevel@tonic-gate 
1317c478bd9Sstevel@tonic-gate 	boolean_t fl_init_token;
1327c478bd9Sstevel@tonic-gate 	boolean_t fl_init_pin;
1337c478bd9Sstevel@tonic-gate 	boolean_t fl_set_pin;
134ba5f469cSkrishna 
135ba5f469cSkrishna 	boolean_t prov_is_limited;
136ba5f469cSkrishna 	uint32_t prov_hash_threshold;
137ba5f469cSkrishna 	uint32_t prov_hash_limit;
138*4a5b2e70Shaimay 
139*4a5b2e70Shaimay 	int total_threshold_count;
140*4a5b2e70Shaimay 	fl_mechs_threshold_t	fl_threshold[MAX_NUM_THRESHOLD];
1417c478bd9Sstevel@tonic-gate } crypto_function_list_t;
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate typedef struct crypto_get_function_list {
1447c478bd9Sstevel@tonic-gate 	uint_t			fl_return_value;
1457c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	fl_provider_id;
1467c478bd9Sstevel@tonic-gate 	crypto_function_list_t	fl_list;
1477c478bd9Sstevel@tonic-gate } crypto_get_function_list_t;
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate typedef struct crypto_get_mechanism_number {
1507c478bd9Sstevel@tonic-gate 	uint_t			pn_return_value;
1517c478bd9Sstevel@tonic-gate 	caddr_t			pn_mechanism_string;
1527c478bd9Sstevel@tonic-gate 	size_t			pn_mechanism_len;
1537c478bd9Sstevel@tonic-gate 	crypto_mech_type_t	pn_internal_number;
1547c478bd9Sstevel@tonic-gate } crypto_get_mechanism_number_t;
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
1577c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
1587c478bd9Sstevel@tonic-gate 
1597c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1607c478bd9Sstevel@tonic-gate #pragma pack(4)
1617c478bd9Sstevel@tonic-gate #endif
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate typedef struct crypto_get_mechanism_number32 {
1647c478bd9Sstevel@tonic-gate 	uint32_t		pn_return_value;
1657c478bd9Sstevel@tonic-gate 	caddr32_t		pn_mechanism_string;
1667c478bd9Sstevel@tonic-gate 	size32_t		pn_mechanism_len;
1677c478bd9Sstevel@tonic-gate 	crypto_mech_type_t	pn_internal_number;
1687c478bd9Sstevel@tonic-gate } crypto_get_mechanism_number32_t;
1697c478bd9Sstevel@tonic-gate 
1707c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1717c478bd9Sstevel@tonic-gate #pragma pack()
1727c478bd9Sstevel@tonic-gate #endif
1737c478bd9Sstevel@tonic-gate 
1747c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1757c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
1767c478bd9Sstevel@tonic-gate 
1777c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_FUNCTION_LIST	CRYPTO(20)
1787c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_MECHANISM_NUMBER	CRYPTO(21)
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate /*
1817c478bd9Sstevel@tonic-gate  * Session Ioctls
1827c478bd9Sstevel@tonic-gate  */
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate typedef uint32_t	crypto_flags_t;
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate typedef struct crypto_open_session {
1877c478bd9Sstevel@tonic-gate 	uint_t			os_return_value;
1887c478bd9Sstevel@tonic-gate 	crypto_session_id_t	os_session;
1897c478bd9Sstevel@tonic-gate 	crypto_flags_t		os_flags;
1907c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	os_provider_id;
1917c478bd9Sstevel@tonic-gate } crypto_open_session_t;
1927c478bd9Sstevel@tonic-gate 
1937c478bd9Sstevel@tonic-gate typedef struct crypto_close_session {
1947c478bd9Sstevel@tonic-gate 	uint_t			cs_return_value;
1957c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
1967c478bd9Sstevel@tonic-gate } crypto_close_session_t;
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate typedef struct crypto_close_all_sessions {
1997c478bd9Sstevel@tonic-gate 	uint_t			as_return_value;
2007c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	as_provider_id;
2017c478bd9Sstevel@tonic-gate } crypto_close_all_sessions_t;
2027c478bd9Sstevel@tonic-gate 
2037c478bd9Sstevel@tonic-gate #define	CRYPTO_OPEN_SESSION		CRYPTO(30)
2047c478bd9Sstevel@tonic-gate #define	CRYPTO_CLOSE_SESSION		CRYPTO(31)
2057c478bd9Sstevel@tonic-gate #define	CRYPTO_CLOSE_ALL_SESSIONS	CRYPTO(32)
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate /*
2087c478bd9Sstevel@tonic-gate  * Login Ioctls
2097c478bd9Sstevel@tonic-gate  */
2107c478bd9Sstevel@tonic-gate typedef struct crypto_login {
2117c478bd9Sstevel@tonic-gate 	uint_t			co_return_value;
2127c478bd9Sstevel@tonic-gate 	crypto_session_id_t	co_session;
2137c478bd9Sstevel@tonic-gate 	uint_t			co_user_type;
2147c478bd9Sstevel@tonic-gate 	uint_t			co_pin_len;
2157c478bd9Sstevel@tonic-gate 	caddr_t			co_pin;
2167c478bd9Sstevel@tonic-gate } crypto_login_t;
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate typedef struct crypto_logout {
2197c478bd9Sstevel@tonic-gate 	uint_t			cl_return_value;
2207c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cl_session;
2217c478bd9Sstevel@tonic-gate } crypto_logout_t;
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
2247c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
2257c478bd9Sstevel@tonic-gate 
2267c478bd9Sstevel@tonic-gate typedef struct crypto_login32 {
2277c478bd9Sstevel@tonic-gate 	uint32_t		co_return_value;
2287c478bd9Sstevel@tonic-gate 	crypto_session_id_t	co_session;
2297c478bd9Sstevel@tonic-gate 	uint32_t		co_user_type;
2307c478bd9Sstevel@tonic-gate 	uint32_t		co_pin_len;
2317c478bd9Sstevel@tonic-gate 	caddr32_t		co_pin;
2327c478bd9Sstevel@tonic-gate } crypto_login32_t;
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate typedef struct crypto_logout32 {
2357c478bd9Sstevel@tonic-gate 	uint32_t		cl_return_value;
2367c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cl_session;
2377c478bd9Sstevel@tonic-gate } crypto_logout32_t;
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2407c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate #define	CRYPTO_LOGIN			CRYPTO(40)
2437c478bd9Sstevel@tonic-gate #define	CRYPTO_LOGOUT			CRYPTO(41)
2447c478bd9Sstevel@tonic-gate 
24587fa5c53Smcpowers /* flag for encrypt and decrypt operations */
24687fa5c53Smcpowers #define	CRYPTO_INPLACE_OPERATION	0x00000001
24787fa5c53Smcpowers 
2487c478bd9Sstevel@tonic-gate /*
2497c478bd9Sstevel@tonic-gate  * Cryptographic Ioctls
2507c478bd9Sstevel@tonic-gate  */
2517c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt {
2527c478bd9Sstevel@tonic-gate 	uint_t			ce_return_value;
2537c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
2547c478bd9Sstevel@tonic-gate 	size_t			ce_datalen;
2557c478bd9Sstevel@tonic-gate 	caddr_t			ce_databuf;
2567c478bd9Sstevel@tonic-gate 	size_t			ce_encrlen;
2577c478bd9Sstevel@tonic-gate 	caddr_t			ce_encrbuf;
25887fa5c53Smcpowers 	uint_t			ce_flags;
2597c478bd9Sstevel@tonic-gate } crypto_encrypt_t;
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_init {
2627c478bd9Sstevel@tonic-gate 	uint_t			ei_return_value;
2637c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
2647c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ei_mech;
2657c478bd9Sstevel@tonic-gate 	crypto_key_t		ei_key;
2667c478bd9Sstevel@tonic-gate } crypto_encrypt_init_t;
2677c478bd9Sstevel@tonic-gate 
2687c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_update {
2697c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
2707c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
2717c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
2727c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
2737c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
2747c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
2757c478bd9Sstevel@tonic-gate } crypto_encrypt_update_t;
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_final {
2787c478bd9Sstevel@tonic-gate 	uint_t			ef_return_value;
2797c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
2807c478bd9Sstevel@tonic-gate 	size_t			ef_encrlen;
2817c478bd9Sstevel@tonic-gate 	caddr_t			ef_encrbuf;
2827c478bd9Sstevel@tonic-gate } crypto_encrypt_final_t;
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt {
2857c478bd9Sstevel@tonic-gate 	uint_t			cd_return_value;
2867c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
2877c478bd9Sstevel@tonic-gate 	size_t			cd_encrlen;
2887c478bd9Sstevel@tonic-gate 	caddr_t			cd_encrbuf;
2897c478bd9Sstevel@tonic-gate 	size_t			cd_datalen;
2907c478bd9Sstevel@tonic-gate 	caddr_t			cd_databuf;
29187fa5c53Smcpowers 	uint_t			cd_flags;
2927c478bd9Sstevel@tonic-gate } crypto_decrypt_t;
2937c478bd9Sstevel@tonic-gate 
2947c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_init {
2957c478bd9Sstevel@tonic-gate 	uint_t			di_return_value;
2967c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
2977c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
2987c478bd9Sstevel@tonic-gate 	crypto_key_t		di_key;
2997c478bd9Sstevel@tonic-gate } crypto_decrypt_init_t;
3007c478bd9Sstevel@tonic-gate 
3017c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_update {
3027c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
3037c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
3047c478bd9Sstevel@tonic-gate 	size_t			du_encrlen;
3057c478bd9Sstevel@tonic-gate 	caddr_t			du_encrbuf;
3067c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
3077c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
3087c478bd9Sstevel@tonic-gate } crypto_decrypt_update_t;
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_final {
3117c478bd9Sstevel@tonic-gate 	uint_t			df_return_value;
3127c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
3137c478bd9Sstevel@tonic-gate 	size_t			df_datalen;
3147c478bd9Sstevel@tonic-gate 	caddr_t			df_databuf;
3157c478bd9Sstevel@tonic-gate } crypto_decrypt_final_t;
3167c478bd9Sstevel@tonic-gate 
3177c478bd9Sstevel@tonic-gate typedef struct crypto_digest {
3187c478bd9Sstevel@tonic-gate 	uint_t			cd_return_value;
3197c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
3207c478bd9Sstevel@tonic-gate 	size_t			cd_datalen;
3217c478bd9Sstevel@tonic-gate 	caddr_t			cd_databuf;
3227c478bd9Sstevel@tonic-gate 	size_t			cd_digestlen;
3237c478bd9Sstevel@tonic-gate 	caddr_t			cd_digestbuf;
3247c478bd9Sstevel@tonic-gate } crypto_digest_t;
3257c478bd9Sstevel@tonic-gate 
3267c478bd9Sstevel@tonic-gate typedef struct crypto_digest_init {
3277c478bd9Sstevel@tonic-gate 	uint_t			di_return_value;
3287c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
3297c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
3307c478bd9Sstevel@tonic-gate } crypto_digest_init_t;
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate typedef struct crypto_digest_update {
3337c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
3347c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
3357c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
3367c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
3377c478bd9Sstevel@tonic-gate } crypto_digest_update_t;
3387c478bd9Sstevel@tonic-gate 
3397c478bd9Sstevel@tonic-gate typedef struct crypto_digest_key {
3407c478bd9Sstevel@tonic-gate 	uint_t			dk_return_value;
3417c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
3427c478bd9Sstevel@tonic-gate 	crypto_key_t		dk_key;
3437c478bd9Sstevel@tonic-gate } crypto_digest_key_t;
3447c478bd9Sstevel@tonic-gate 
3457c478bd9Sstevel@tonic-gate typedef struct crypto_digest_final {
3467c478bd9Sstevel@tonic-gate 	uint_t			df_return_value;
3477c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
3487c478bd9Sstevel@tonic-gate 	size_t			df_digestlen;
3497c478bd9Sstevel@tonic-gate 	caddr_t			df_digestbuf;
3507c478bd9Sstevel@tonic-gate } crypto_digest_final_t;
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate typedef struct crypto_mac {
3537c478bd9Sstevel@tonic-gate 	uint_t			cm_return_value;
3547c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
3557c478bd9Sstevel@tonic-gate 	size_t			cm_datalen;
3567c478bd9Sstevel@tonic-gate 	caddr_t			cm_databuf;
3577c478bd9Sstevel@tonic-gate 	size_t			cm_maclen;
3587c478bd9Sstevel@tonic-gate 	caddr_t			cm_macbuf;
3597c478bd9Sstevel@tonic-gate } crypto_mac_t;
3607c478bd9Sstevel@tonic-gate 
3617c478bd9Sstevel@tonic-gate typedef struct crypto_mac_init {
3627c478bd9Sstevel@tonic-gate 	uint_t			mi_return_value;
3637c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
3647c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	mi_mech;
3657c478bd9Sstevel@tonic-gate 	crypto_key_t		mi_key;
3667c478bd9Sstevel@tonic-gate } crypto_mac_init_t;
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate typedef struct crypto_mac_update {
3697c478bd9Sstevel@tonic-gate 	uint_t			mu_return_value;
3707c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
3717c478bd9Sstevel@tonic-gate 	size_t			mu_datalen;
3727c478bd9Sstevel@tonic-gate 	caddr_t			mu_databuf;
3737c478bd9Sstevel@tonic-gate } crypto_mac_update_t;
3747c478bd9Sstevel@tonic-gate 
3757c478bd9Sstevel@tonic-gate typedef struct crypto_mac_final {
3767c478bd9Sstevel@tonic-gate 	uint_t			mf_return_value;
3777c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
3787c478bd9Sstevel@tonic-gate 	size_t			mf_maclen;
3797c478bd9Sstevel@tonic-gate 	caddr_t			mf_macbuf;
3807c478bd9Sstevel@tonic-gate } crypto_mac_final_t;
3817c478bd9Sstevel@tonic-gate 
3827c478bd9Sstevel@tonic-gate typedef struct crypto_sign {
3837c478bd9Sstevel@tonic-gate 	uint_t			cs_return_value;
3847c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
3857c478bd9Sstevel@tonic-gate 	size_t			cs_datalen;
3867c478bd9Sstevel@tonic-gate 	caddr_t			cs_databuf;
3877c478bd9Sstevel@tonic-gate 	size_t			cs_signlen;
3887c478bd9Sstevel@tonic-gate 	caddr_t			cs_signbuf;
3897c478bd9Sstevel@tonic-gate } crypto_sign_t;
3907c478bd9Sstevel@tonic-gate 
3917c478bd9Sstevel@tonic-gate typedef struct crypto_sign_init {
3927c478bd9Sstevel@tonic-gate 	uint_t			si_return_value;
3937c478bd9Sstevel@tonic-gate 	crypto_session_id_t	si_session;
3947c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	si_mech;
3957c478bd9Sstevel@tonic-gate 	crypto_key_t		si_key;
3967c478bd9Sstevel@tonic-gate } crypto_sign_init_t;
3977c478bd9Sstevel@tonic-gate 
3987c478bd9Sstevel@tonic-gate typedef struct crypto_sign_update {
3997c478bd9Sstevel@tonic-gate 	uint_t			su_return_value;
4007c478bd9Sstevel@tonic-gate 	crypto_session_id_t	su_session;
4017c478bd9Sstevel@tonic-gate 	size_t			su_datalen;
4027c478bd9Sstevel@tonic-gate 	caddr_t			su_databuf;
4037c478bd9Sstevel@tonic-gate } crypto_sign_update_t;
4047c478bd9Sstevel@tonic-gate 
4057c478bd9Sstevel@tonic-gate typedef struct crypto_sign_final {
4067c478bd9Sstevel@tonic-gate 	uint_t			sf_return_value;
4077c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
4087c478bd9Sstevel@tonic-gate 	size_t			sf_signlen;
4097c478bd9Sstevel@tonic-gate 	caddr_t			sf_signbuf;
4107c478bd9Sstevel@tonic-gate } crypto_sign_final_t;
4117c478bd9Sstevel@tonic-gate 
4127c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover_init {
4137c478bd9Sstevel@tonic-gate 	uint_t			ri_return_value;
4147c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
4157c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
4167c478bd9Sstevel@tonic-gate 	crypto_key_t		ri_key;
4177c478bd9Sstevel@tonic-gate } crypto_sign_recover_init_t;
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover {
4207c478bd9Sstevel@tonic-gate 	uint_t			sr_return_value;
4217c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
4227c478bd9Sstevel@tonic-gate 	size_t			sr_datalen;
4237c478bd9Sstevel@tonic-gate 	caddr_t			sr_databuf;
4247c478bd9Sstevel@tonic-gate 	size_t			sr_signlen;
4257c478bd9Sstevel@tonic-gate 	caddr_t			sr_signbuf;
4267c478bd9Sstevel@tonic-gate } crypto_sign_recover_t;
4277c478bd9Sstevel@tonic-gate 
4287c478bd9Sstevel@tonic-gate typedef struct crypto_verify {
4297c478bd9Sstevel@tonic-gate 	uint_t			cv_return_value;
4307c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
4317c478bd9Sstevel@tonic-gate 	size_t			cv_datalen;
4327c478bd9Sstevel@tonic-gate 	caddr_t			cv_databuf;
4337c478bd9Sstevel@tonic-gate 	size_t			cv_signlen;
4347c478bd9Sstevel@tonic-gate 	caddr_t			cv_signbuf;
4357c478bd9Sstevel@tonic-gate } crypto_verify_t;
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate typedef struct crypto_verify_init {
4387c478bd9Sstevel@tonic-gate 	uint_t			vi_return_value;
4397c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
4407c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	vi_mech;
4417c478bd9Sstevel@tonic-gate 	crypto_key_t		vi_key;
4427c478bd9Sstevel@tonic-gate } crypto_verify_init_t;
4437c478bd9Sstevel@tonic-gate 
4447c478bd9Sstevel@tonic-gate typedef struct crypto_verify_update {
4457c478bd9Sstevel@tonic-gate 	uint_t			vu_return_value;
4467c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
4477c478bd9Sstevel@tonic-gate 	size_t			vu_datalen;
4487c478bd9Sstevel@tonic-gate 	caddr_t			vu_databuf;
4497c478bd9Sstevel@tonic-gate } crypto_verify_update_t;
4507c478bd9Sstevel@tonic-gate 
4517c478bd9Sstevel@tonic-gate typedef struct crypto_verify_final {
4527c478bd9Sstevel@tonic-gate 	uint_t			vf_return_value;
4537c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
4547c478bd9Sstevel@tonic-gate 	size_t			vf_signlen;
4557c478bd9Sstevel@tonic-gate 	caddr_t			vf_signbuf;
4567c478bd9Sstevel@tonic-gate } crypto_verify_final_t;
4577c478bd9Sstevel@tonic-gate 
4587c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover_init {
4597c478bd9Sstevel@tonic-gate 	uint_t			ri_return_value;
4607c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
4617c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
4627c478bd9Sstevel@tonic-gate 	crypto_key_t		ri_key;
4637c478bd9Sstevel@tonic-gate } crypto_verify_recover_init_t;
4647c478bd9Sstevel@tonic-gate 
4657c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover {
4667c478bd9Sstevel@tonic-gate 	uint_t			vr_return_value;
4677c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
4687c478bd9Sstevel@tonic-gate 	size_t			vr_signlen;
4697c478bd9Sstevel@tonic-gate 	caddr_t			vr_signbuf;
4707c478bd9Sstevel@tonic-gate 	size_t			vr_datalen;
4717c478bd9Sstevel@tonic-gate 	caddr_t			vr_databuf;
4727c478bd9Sstevel@tonic-gate } crypto_verify_recover_t;
4737c478bd9Sstevel@tonic-gate 
4747c478bd9Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update {
4757c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
4767c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4777c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
4787c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
4797c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
4807c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
4817c478bd9Sstevel@tonic-gate } crypto_digest_encrypt_update_t;
4827c478bd9Sstevel@tonic-gate 
4837c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update {
4847c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
4857c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
4867c478bd9Sstevel@tonic-gate 	size_t			du_encrlen;
4877c478bd9Sstevel@tonic-gate 	caddr_t			du_encrbuf;
4887c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
4897c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
4907c478bd9Sstevel@tonic-gate } crypto_decrypt_digest_update_t;
4917c478bd9Sstevel@tonic-gate 
4927c478bd9Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update {
4937c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
4947c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4957c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
4967c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
4977c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
4987c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
4997c478bd9Sstevel@tonic-gate } crypto_sign_encrypt_update_t;
5007c478bd9Sstevel@tonic-gate 
5017c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update {
5027c478bd9Sstevel@tonic-gate 	uint_t			vu_return_value;
5037c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
5047c478bd9Sstevel@tonic-gate 	size_t			vu_encrlen;
5057c478bd9Sstevel@tonic-gate 	caddr_t			vu_encrbuf;
5067c478bd9Sstevel@tonic-gate 	size_t			vu_datalen;
5077c478bd9Sstevel@tonic-gate 	caddr_t			vu_databuf;
5087c478bd9Sstevel@tonic-gate } crypto_decrypt_verify_update_t;
5097c478bd9Sstevel@tonic-gate 
5107c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
5117c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
5127c478bd9Sstevel@tonic-gate 
5137c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt32 {
5147c478bd9Sstevel@tonic-gate 	uint32_t		ce_return_value;
5157c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
5167c478bd9Sstevel@tonic-gate 	size32_t		ce_datalen;
5177c478bd9Sstevel@tonic-gate 	caddr32_t		ce_databuf;
5187c478bd9Sstevel@tonic-gate 	size32_t		ce_encrlen;
5197c478bd9Sstevel@tonic-gate 	caddr32_t		ce_encrbuf;
52087fa5c53Smcpowers 	uint32_t		ce_flags;
5217c478bd9Sstevel@tonic-gate } crypto_encrypt32_t;
5227c478bd9Sstevel@tonic-gate 
5237c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5247c478bd9Sstevel@tonic-gate #pragma pack(4)
5257c478bd9Sstevel@tonic-gate #endif
5267c478bd9Sstevel@tonic-gate 
5277c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_init32 {
5287c478bd9Sstevel@tonic-gate 	uint32_t		ei_return_value;
5297c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
5307c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ei_mech;
5317c478bd9Sstevel@tonic-gate 	crypto_key32_t		ei_key;
5327c478bd9Sstevel@tonic-gate } crypto_encrypt_init32_t;
5337c478bd9Sstevel@tonic-gate 
5347c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5357c478bd9Sstevel@tonic-gate #pragma pack()
5367c478bd9Sstevel@tonic-gate #endif
5377c478bd9Sstevel@tonic-gate 
5387c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_update32 {
5397c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
5407c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
5417c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
5427c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
5437c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
5447c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
5457c478bd9Sstevel@tonic-gate } crypto_encrypt_update32_t;
5467c478bd9Sstevel@tonic-gate 
5477c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_final32 {
5487c478bd9Sstevel@tonic-gate 	uint32_t		ef_return_value;
5497c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
5507c478bd9Sstevel@tonic-gate 	size32_t		ef_encrlen;
5517c478bd9Sstevel@tonic-gate 	caddr32_t		ef_encrbuf;
5527c478bd9Sstevel@tonic-gate } crypto_encrypt_final32_t;
5537c478bd9Sstevel@tonic-gate 
5547c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt32 {
5557c478bd9Sstevel@tonic-gate 	uint32_t		cd_return_value;
5567c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
5577c478bd9Sstevel@tonic-gate 	size32_t		cd_encrlen;
5587c478bd9Sstevel@tonic-gate 	caddr32_t		cd_encrbuf;
5597c478bd9Sstevel@tonic-gate 	size32_t		cd_datalen;
5607c478bd9Sstevel@tonic-gate 	caddr32_t		cd_databuf;
56187fa5c53Smcpowers 	uint32_t		cd_flags;
5627c478bd9Sstevel@tonic-gate } crypto_decrypt32_t;
5637c478bd9Sstevel@tonic-gate 
5647c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5657c478bd9Sstevel@tonic-gate #pragma pack(4)
5667c478bd9Sstevel@tonic-gate #endif
5677c478bd9Sstevel@tonic-gate 
5687c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_init32 {
5697c478bd9Sstevel@tonic-gate 	uint32_t		di_return_value;
5707c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
5717c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
5727c478bd9Sstevel@tonic-gate 	crypto_key32_t		di_key;
5737c478bd9Sstevel@tonic-gate } crypto_decrypt_init32_t;
5747c478bd9Sstevel@tonic-gate 
5757c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5767c478bd9Sstevel@tonic-gate #pragma pack()
5777c478bd9Sstevel@tonic-gate #endif
5787c478bd9Sstevel@tonic-gate 
5797c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_update32 {
5807c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
5817c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
5827c478bd9Sstevel@tonic-gate 	size32_t		du_encrlen;
5837c478bd9Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
5847c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
5857c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
5867c478bd9Sstevel@tonic-gate } crypto_decrypt_update32_t;
5877c478bd9Sstevel@tonic-gate 
5887c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_final32 {
5897c478bd9Sstevel@tonic-gate 	uint32_t		df_return_value;
5907c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
5917c478bd9Sstevel@tonic-gate 	size32_t		df_datalen;
5927c478bd9Sstevel@tonic-gate 	caddr32_t		df_databuf;
5937c478bd9Sstevel@tonic-gate } crypto_decrypt_final32_t;
5947c478bd9Sstevel@tonic-gate 
5957c478bd9Sstevel@tonic-gate typedef struct crypto_digest32 {
5967c478bd9Sstevel@tonic-gate 	uint32_t		cd_return_value;
5977c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
5987c478bd9Sstevel@tonic-gate 	size32_t		cd_datalen;
5997c478bd9Sstevel@tonic-gate 	caddr32_t		cd_databuf;
6007c478bd9Sstevel@tonic-gate 	size32_t		cd_digestlen;
6017c478bd9Sstevel@tonic-gate 	caddr32_t		cd_digestbuf;
6027c478bd9Sstevel@tonic-gate } crypto_digest32_t;
6037c478bd9Sstevel@tonic-gate 
6047c478bd9Sstevel@tonic-gate typedef struct crypto_digest_init32 {
6057c478bd9Sstevel@tonic-gate 	uint32_t		di_return_value;
6067c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
6077c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
6087c478bd9Sstevel@tonic-gate } crypto_digest_init32_t;
6097c478bd9Sstevel@tonic-gate 
6107c478bd9Sstevel@tonic-gate typedef struct crypto_digest_update32 {
6117c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
6127c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
6137c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
6147c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
6157c478bd9Sstevel@tonic-gate } crypto_digest_update32_t;
6167c478bd9Sstevel@tonic-gate 
6177c478bd9Sstevel@tonic-gate typedef struct crypto_digest_key32 {
6187c478bd9Sstevel@tonic-gate 	uint32_t		dk_return_value;
6197c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
6207c478bd9Sstevel@tonic-gate 	crypto_key32_t		dk_key;
6217c478bd9Sstevel@tonic-gate } crypto_digest_key32_t;
6227c478bd9Sstevel@tonic-gate 
6237c478bd9Sstevel@tonic-gate typedef struct crypto_digest_final32 {
6247c478bd9Sstevel@tonic-gate 	uint32_t		df_return_value;
6257c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
6267c478bd9Sstevel@tonic-gate 	size32_t		df_digestlen;
6277c478bd9Sstevel@tonic-gate 	caddr32_t		df_digestbuf;
6287c478bd9Sstevel@tonic-gate } crypto_digest_final32_t;
6297c478bd9Sstevel@tonic-gate 
6307c478bd9Sstevel@tonic-gate typedef struct crypto_mac32 {
6317c478bd9Sstevel@tonic-gate 	uint32_t		cm_return_value;
6327c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
6337c478bd9Sstevel@tonic-gate 	size32_t		cm_datalen;
6347c478bd9Sstevel@tonic-gate 	caddr32_t		cm_databuf;
6357c478bd9Sstevel@tonic-gate 	size32_t		cm_maclen;
6367c478bd9Sstevel@tonic-gate 	caddr32_t		cm_macbuf;
6377c478bd9Sstevel@tonic-gate } crypto_mac32_t;
6387c478bd9Sstevel@tonic-gate 
6397c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6407c478bd9Sstevel@tonic-gate #pragma pack(4)
6417c478bd9Sstevel@tonic-gate #endif
6427c478bd9Sstevel@tonic-gate 
6437c478bd9Sstevel@tonic-gate typedef struct crypto_mac_init32 {
6447c478bd9Sstevel@tonic-gate 	uint32_t		mi_return_value;
6457c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
6467c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	mi_mech;
6477c478bd9Sstevel@tonic-gate 	crypto_key32_t		mi_key;
6487c478bd9Sstevel@tonic-gate } crypto_mac_init32_t;
6497c478bd9Sstevel@tonic-gate 
6507c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6517c478bd9Sstevel@tonic-gate #pragma pack()
6527c478bd9Sstevel@tonic-gate #endif
6537c478bd9Sstevel@tonic-gate 
6547c478bd9Sstevel@tonic-gate typedef struct crypto_mac_update32 {
6557c478bd9Sstevel@tonic-gate 	uint32_t		mu_return_value;
6567c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
6577c478bd9Sstevel@tonic-gate 	size32_t		mu_datalen;
6587c478bd9Sstevel@tonic-gate 	caddr32_t		mu_databuf;
6597c478bd9Sstevel@tonic-gate } crypto_mac_update32_t;
6607c478bd9Sstevel@tonic-gate 
6617c478bd9Sstevel@tonic-gate typedef struct crypto_mac_final32 {
6627c478bd9Sstevel@tonic-gate 	uint32_t		mf_return_value;
6637c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
6647c478bd9Sstevel@tonic-gate 	size32_t		mf_maclen;
6657c478bd9Sstevel@tonic-gate 	caddr32_t		mf_macbuf;
6667c478bd9Sstevel@tonic-gate } crypto_mac_final32_t;
6677c478bd9Sstevel@tonic-gate 
6687c478bd9Sstevel@tonic-gate typedef struct crypto_sign32 {
6697c478bd9Sstevel@tonic-gate 	uint32_t		cs_return_value;
6707c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
6717c478bd9Sstevel@tonic-gate 	size32_t		cs_datalen;
6727c478bd9Sstevel@tonic-gate 	caddr32_t		cs_databuf;
6737c478bd9Sstevel@tonic-gate 	size32_t		cs_signlen;
6747c478bd9Sstevel@tonic-gate 	caddr32_t		cs_signbuf;
6757c478bd9Sstevel@tonic-gate } crypto_sign32_t;
6767c478bd9Sstevel@tonic-gate 
6777c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6787c478bd9Sstevel@tonic-gate #pragma pack(4)
6797c478bd9Sstevel@tonic-gate #endif
6807c478bd9Sstevel@tonic-gate 
6817c478bd9Sstevel@tonic-gate typedef struct crypto_sign_init32 {
6827c478bd9Sstevel@tonic-gate 	uint32_t		si_return_value;
6837c478bd9Sstevel@tonic-gate 	crypto_session_id_t	si_session;
6847c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	si_mech;
6857c478bd9Sstevel@tonic-gate 	crypto_key32_t		si_key;
6867c478bd9Sstevel@tonic-gate } crypto_sign_init32_t;
6877c478bd9Sstevel@tonic-gate 
6887c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6897c478bd9Sstevel@tonic-gate #pragma pack()
6907c478bd9Sstevel@tonic-gate #endif
6917c478bd9Sstevel@tonic-gate 
6927c478bd9Sstevel@tonic-gate typedef struct crypto_sign_update32 {
6937c478bd9Sstevel@tonic-gate 	uint32_t		su_return_value;
6947c478bd9Sstevel@tonic-gate 	crypto_session_id_t	su_session;
6957c478bd9Sstevel@tonic-gate 	size32_t		su_datalen;
6967c478bd9Sstevel@tonic-gate 	caddr32_t		su_databuf;
6977c478bd9Sstevel@tonic-gate } crypto_sign_update32_t;
6987c478bd9Sstevel@tonic-gate 
6997c478bd9Sstevel@tonic-gate typedef struct crypto_sign_final32 {
7007c478bd9Sstevel@tonic-gate 	uint32_t		sf_return_value;
7017c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
7027c478bd9Sstevel@tonic-gate 	size32_t		sf_signlen;
7037c478bd9Sstevel@tonic-gate 	caddr32_t		sf_signbuf;
7047c478bd9Sstevel@tonic-gate } crypto_sign_final32_t;
7057c478bd9Sstevel@tonic-gate 
7067c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7077c478bd9Sstevel@tonic-gate #pragma pack(4)
7087c478bd9Sstevel@tonic-gate #endif
7097c478bd9Sstevel@tonic-gate 
7107c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover_init32 {
7117c478bd9Sstevel@tonic-gate 	uint32_t		ri_return_value;
7127c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
7137c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
7147c478bd9Sstevel@tonic-gate 	crypto_key32_t		ri_key;
7157c478bd9Sstevel@tonic-gate } crypto_sign_recover_init32_t;
7167c478bd9Sstevel@tonic-gate 
7177c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7187c478bd9Sstevel@tonic-gate #pragma pack()
7197c478bd9Sstevel@tonic-gate #endif
7207c478bd9Sstevel@tonic-gate 
7217c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover32 {
7227c478bd9Sstevel@tonic-gate 	uint32_t		sr_return_value;
7237c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
7247c478bd9Sstevel@tonic-gate 	size32_t		sr_datalen;
7257c478bd9Sstevel@tonic-gate 	caddr32_t		sr_databuf;
7267c478bd9Sstevel@tonic-gate 	size32_t		sr_signlen;
7277c478bd9Sstevel@tonic-gate 	caddr32_t		sr_signbuf;
7287c478bd9Sstevel@tonic-gate } crypto_sign_recover32_t;
7297c478bd9Sstevel@tonic-gate 
7307c478bd9Sstevel@tonic-gate typedef struct crypto_verify32 {
7317c478bd9Sstevel@tonic-gate 	uint32_t		cv_return_value;
7327c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
7337c478bd9Sstevel@tonic-gate 	size32_t		cv_datalen;
7347c478bd9Sstevel@tonic-gate 	caddr32_t		cv_databuf;
7357c478bd9Sstevel@tonic-gate 	size32_t		cv_signlen;
7367c478bd9Sstevel@tonic-gate 	caddr32_t		cv_signbuf;
7377c478bd9Sstevel@tonic-gate } crypto_verify32_t;
7387c478bd9Sstevel@tonic-gate 
7397c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7407c478bd9Sstevel@tonic-gate #pragma pack(4)
7417c478bd9Sstevel@tonic-gate #endif
7427c478bd9Sstevel@tonic-gate 
7437c478bd9Sstevel@tonic-gate typedef struct crypto_verify_init32 {
7447c478bd9Sstevel@tonic-gate 	uint32_t		vi_return_value;
7457c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
7467c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	vi_mech;
7477c478bd9Sstevel@tonic-gate 	crypto_key32_t		vi_key;
7487c478bd9Sstevel@tonic-gate } crypto_verify_init32_t;
7497c478bd9Sstevel@tonic-gate 
7507c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7517c478bd9Sstevel@tonic-gate #pragma pack()
7527c478bd9Sstevel@tonic-gate #endif
7537c478bd9Sstevel@tonic-gate 
7547c478bd9Sstevel@tonic-gate typedef struct crypto_verify_update32 {
7557c478bd9Sstevel@tonic-gate 	uint32_t		vu_return_value;
7567c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
7577c478bd9Sstevel@tonic-gate 	size32_t		vu_datalen;
7587c478bd9Sstevel@tonic-gate 	caddr32_t		vu_databuf;
7597c478bd9Sstevel@tonic-gate } crypto_verify_update32_t;
7607c478bd9Sstevel@tonic-gate 
7617c478bd9Sstevel@tonic-gate typedef struct crypto_verify_final32 {
7627c478bd9Sstevel@tonic-gate 	uint32_t		vf_return_value;
7637c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
7647c478bd9Sstevel@tonic-gate 	size32_t		vf_signlen;
7657c478bd9Sstevel@tonic-gate 	caddr32_t		vf_signbuf;
7667c478bd9Sstevel@tonic-gate } crypto_verify_final32_t;
7677c478bd9Sstevel@tonic-gate 
7687c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7697c478bd9Sstevel@tonic-gate #pragma pack(4)
7707c478bd9Sstevel@tonic-gate #endif
7717c478bd9Sstevel@tonic-gate 
7727c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover_init32 {
7737c478bd9Sstevel@tonic-gate 	uint32_t		ri_return_value;
7747c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
7757c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
7767c478bd9Sstevel@tonic-gate 	crypto_key32_t		ri_key;
7777c478bd9Sstevel@tonic-gate } crypto_verify_recover_init32_t;
7787c478bd9Sstevel@tonic-gate 
7797c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7807c478bd9Sstevel@tonic-gate #pragma pack()
7817c478bd9Sstevel@tonic-gate #endif
7827c478bd9Sstevel@tonic-gate 
7837c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover32 {
7847c478bd9Sstevel@tonic-gate 	uint32_t		vr_return_value;
7857c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
7867c478bd9Sstevel@tonic-gate 	size32_t		vr_signlen;
7877c478bd9Sstevel@tonic-gate 	caddr32_t		vr_signbuf;
7887c478bd9Sstevel@tonic-gate 	size32_t		vr_datalen;
7897c478bd9Sstevel@tonic-gate 	caddr32_t		vr_databuf;
7907c478bd9Sstevel@tonic-gate } crypto_verify_recover32_t;
7917c478bd9Sstevel@tonic-gate 
7927c478bd9Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update32 {
7937c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
7947c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
7957c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
7967c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
7977c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
7987c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
7997c478bd9Sstevel@tonic-gate } crypto_digest_encrypt_update32_t;
8007c478bd9Sstevel@tonic-gate 
8017c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update32 {
8027c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
8037c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
8047c478bd9Sstevel@tonic-gate 	size32_t		du_encrlen;
8057c478bd9Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
8067c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
8077c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
8087c478bd9Sstevel@tonic-gate } crypto_decrypt_digest_update32_t;
8097c478bd9Sstevel@tonic-gate 
8107c478bd9Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update32 {
8117c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
8127c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
8137c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
8147c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
8157c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
8167c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
8177c478bd9Sstevel@tonic-gate } crypto_sign_encrypt_update32_t;
8187c478bd9Sstevel@tonic-gate 
8197c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update32 {
8207c478bd9Sstevel@tonic-gate 	uint32_t		vu_return_value;
8217c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
8227c478bd9Sstevel@tonic-gate 	size32_t		vu_encrlen;
8237c478bd9Sstevel@tonic-gate 	caddr32_t		vu_encrbuf;
8247c478bd9Sstevel@tonic-gate 	size32_t		vu_datalen;
8257c478bd9Sstevel@tonic-gate 	caddr32_t		vu_databuf;
8267c478bd9Sstevel@tonic-gate } crypto_decrypt_verify_update32_t;
8277c478bd9Sstevel@tonic-gate 
8287c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
8297c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
8307c478bd9Sstevel@tonic-gate 
8317c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT			CRYPTO(50)
8327c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_INIT		CRYPTO(51)
8337c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_UPDATE		CRYPTO(52)
8347c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_FINAL		CRYPTO(53)
8357c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT			CRYPTO(54)
8367c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_INIT		CRYPTO(55)
8377c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_UPDATE		CRYPTO(56)
8387c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_FINAL		CRYPTO(57)
8397c478bd9Sstevel@tonic-gate 
8407c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST			CRYPTO(58)
8417c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_INIT		CRYPTO(59)
8427c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_UPDATE		CRYPTO(60)
8437c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_KEY		CRYPTO(61)
8447c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_FINAL		CRYPTO(62)
8457c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC			CRYPTO(63)
8467c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_INIT			CRYPTO(64)
8477c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_UPDATE		CRYPTO(65)
8487c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_FINAL		CRYPTO(66)
8497c478bd9Sstevel@tonic-gate 
8507c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN			CRYPTO(67)
8517c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_INIT		CRYPTO(68)
8527c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_UPDATE		CRYPTO(69)
8537c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_FINAL		CRYPTO(70)
8547c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER_INIT	CRYPTO(71)
8557c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER		CRYPTO(72)
8567c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY			CRYPTO(73)
8577c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_INIT		CRYPTO(74)
8587c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_UPDATE		CRYPTO(75)
8597c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_FINAL		CRYPTO(76)
8607c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER_INIT	CRYPTO(77)
8617c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER		CRYPTO(78)
8627c478bd9Sstevel@tonic-gate 
8637c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_ENCRYPT_UPDATE	CRYPTO(79)
8647c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_DIGEST_UPDATE	CRYPTO(80)
8657c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_ENCRYPT_UPDATE	CRYPTO(81)
8667c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_VERIFY_UPDATE	CRYPTO(82)
8677c478bd9Sstevel@tonic-gate 
8687c478bd9Sstevel@tonic-gate /*
8697c478bd9Sstevel@tonic-gate  * Random Number Ioctls
8707c478bd9Sstevel@tonic-gate  */
8717c478bd9Sstevel@tonic-gate typedef struct crypto_seed_random {
8727c478bd9Sstevel@tonic-gate 	uint_t			sr_return_value;
8737c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8747c478bd9Sstevel@tonic-gate 	size_t			sr_seedlen;
8757c478bd9Sstevel@tonic-gate 	caddr_t			sr_seedbuf;
8767c478bd9Sstevel@tonic-gate } crypto_seed_random_t;
8777c478bd9Sstevel@tonic-gate 
8787c478bd9Sstevel@tonic-gate typedef struct crypto_generate_random {
8797c478bd9Sstevel@tonic-gate 	uint_t			gr_return_value;
8807c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
8817c478bd9Sstevel@tonic-gate 	caddr_t			gr_buf;
8827c478bd9Sstevel@tonic-gate 	size_t			gr_buflen;
8837c478bd9Sstevel@tonic-gate } crypto_generate_random_t;
8847c478bd9Sstevel@tonic-gate 
8857c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
8867c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
8877c478bd9Sstevel@tonic-gate 
8887c478bd9Sstevel@tonic-gate typedef struct crypto_seed_random32 {
8897c478bd9Sstevel@tonic-gate 	uint32_t		sr_return_value;
8907c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8917c478bd9Sstevel@tonic-gate 	size32_t		sr_seedlen;
8927c478bd9Sstevel@tonic-gate 	caddr32_t		sr_seedbuf;
8937c478bd9Sstevel@tonic-gate } crypto_seed_random32_t;
8947c478bd9Sstevel@tonic-gate 
8957c478bd9Sstevel@tonic-gate typedef struct crypto_generate_random32 {
8967c478bd9Sstevel@tonic-gate 	uint32_t		gr_return_value;
8977c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
8987c478bd9Sstevel@tonic-gate 	caddr32_t		gr_buf;
8997c478bd9Sstevel@tonic-gate 	size32_t		gr_buflen;
9007c478bd9Sstevel@tonic-gate } crypto_generate_random32_t;
9017c478bd9Sstevel@tonic-gate 
9027c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
9037c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
9047c478bd9Sstevel@tonic-gate 
9057c478bd9Sstevel@tonic-gate #define	CRYPTO_SEED_RANDOM		CRYPTO(90)
9067c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_RANDOM		CRYPTO(91)
9077c478bd9Sstevel@tonic-gate 
9087c478bd9Sstevel@tonic-gate /*
9097c478bd9Sstevel@tonic-gate  * Object Management Ioctls
9107c478bd9Sstevel@tonic-gate  */
9117c478bd9Sstevel@tonic-gate typedef struct crypto_object_create {
9127c478bd9Sstevel@tonic-gate 	uint_t			oc_return_value;
9137c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9147c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9157c478bd9Sstevel@tonic-gate 	uint_t			oc_count;
9167c478bd9Sstevel@tonic-gate 	caddr_t			oc_attributes;
9177c478bd9Sstevel@tonic-gate } crypto_object_create_t;
9187c478bd9Sstevel@tonic-gate 
9197c478bd9Sstevel@tonic-gate typedef struct crypto_object_copy {
9207c478bd9Sstevel@tonic-gate 	uint_t			oc_return_value;
9217c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9227c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9237c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
9247c478bd9Sstevel@tonic-gate 	uint_t			oc_count;
9257c478bd9Sstevel@tonic-gate 	caddr_t			oc_new_attributes;
9267c478bd9Sstevel@tonic-gate } crypto_object_copy_t;
9277c478bd9Sstevel@tonic-gate 
9287c478bd9Sstevel@tonic-gate typedef struct crypto_object_destroy {
9297c478bd9Sstevel@tonic-gate 	uint_t			od_return_value;
9307c478bd9Sstevel@tonic-gate 	crypto_session_id_t	od_session;
9317c478bd9Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
9327c478bd9Sstevel@tonic-gate } crypto_object_destroy_t;
9337c478bd9Sstevel@tonic-gate 
9347c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value {
9357c478bd9Sstevel@tonic-gate 	uint_t			og_return_value;
9367c478bd9Sstevel@tonic-gate 	crypto_session_id_t	og_session;
9377c478bd9Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
9387c478bd9Sstevel@tonic-gate 	uint_t			og_count;
9397c478bd9Sstevel@tonic-gate 	caddr_t			og_attributes;
9407c478bd9Sstevel@tonic-gate } crypto_object_get_attribute_value_t;
9417c478bd9Sstevel@tonic-gate 
9427c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_size {
9437c478bd9Sstevel@tonic-gate 	uint_t			gs_return_value;
9447c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
9457c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
9467c478bd9Sstevel@tonic-gate 	size_t			gs_size;
9477c478bd9Sstevel@tonic-gate } crypto_object_get_size_t;
9487c478bd9Sstevel@tonic-gate 
9497c478bd9Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value {
9507c478bd9Sstevel@tonic-gate 	uint_t			sa_return_value;
9517c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
9527c478bd9Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
9537c478bd9Sstevel@tonic-gate 	uint_t			sa_count;
9547c478bd9Sstevel@tonic-gate 	caddr_t			sa_attributes;
9557c478bd9Sstevel@tonic-gate } crypto_object_set_attribute_value_t;
9567c478bd9Sstevel@tonic-gate 
9577c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_init {
9587c478bd9Sstevel@tonic-gate 	uint_t			fi_return_value;
9597c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
9607c478bd9Sstevel@tonic-gate 	uint_t			fi_count;
9617c478bd9Sstevel@tonic-gate 	caddr_t			fi_attributes;
9627c478bd9Sstevel@tonic-gate } crypto_object_find_init_t;
9637c478bd9Sstevel@tonic-gate 
9647c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_update {
9657c478bd9Sstevel@tonic-gate 	uint_t			fu_return_value;
9667c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
9677c478bd9Sstevel@tonic-gate 	uint_t			fu_max_count;
9687c478bd9Sstevel@tonic-gate 	uint_t			fu_count;
9697c478bd9Sstevel@tonic-gate 	caddr_t			fu_handles;
9707c478bd9Sstevel@tonic-gate } crypto_object_find_update_t;
9717c478bd9Sstevel@tonic-gate 
9727c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_final {
9737c478bd9Sstevel@tonic-gate 	uint_t			ff_return_value;
9747c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
9757c478bd9Sstevel@tonic-gate } crypto_object_find_final_t;
9767c478bd9Sstevel@tonic-gate 
9777c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
9787c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
9797c478bd9Sstevel@tonic-gate 
9807c478bd9Sstevel@tonic-gate typedef struct crypto_object_create32 {
9817c478bd9Sstevel@tonic-gate 	uint32_t		oc_return_value;
9827c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9837c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9847c478bd9Sstevel@tonic-gate 	uint32_t		oc_count;
9857c478bd9Sstevel@tonic-gate 	caddr32_t		oc_attributes;
9867c478bd9Sstevel@tonic-gate } crypto_object_create32_t;
9877c478bd9Sstevel@tonic-gate 
9887c478bd9Sstevel@tonic-gate typedef struct crypto_object_copy32 {
9897c478bd9Sstevel@tonic-gate 	uint32_t		oc_return_value;
9907c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9917c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9927c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
9937c478bd9Sstevel@tonic-gate 	uint32_t		oc_count;
9947c478bd9Sstevel@tonic-gate 	caddr32_t		oc_new_attributes;
9957c478bd9Sstevel@tonic-gate } crypto_object_copy32_t;
9967c478bd9Sstevel@tonic-gate 
9977c478bd9Sstevel@tonic-gate typedef struct crypto_object_destroy32 {
9987c478bd9Sstevel@tonic-gate 	uint32_t		od_return_value;
9997c478bd9Sstevel@tonic-gate 	crypto_session_id_t	od_session;
10007c478bd9Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
10017c478bd9Sstevel@tonic-gate } crypto_object_destroy32_t;
10027c478bd9Sstevel@tonic-gate 
10037c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value32 {
10047c478bd9Sstevel@tonic-gate 	uint32_t		og_return_value;
10057c478bd9Sstevel@tonic-gate 	crypto_session_id_t	og_session;
10067c478bd9Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
10077c478bd9Sstevel@tonic-gate 	uint32_t		og_count;
10087c478bd9Sstevel@tonic-gate 	caddr32_t		og_attributes;
10097c478bd9Sstevel@tonic-gate } crypto_object_get_attribute_value32_t;
10107c478bd9Sstevel@tonic-gate 
10117c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_size32 {
10127c478bd9Sstevel@tonic-gate 	uint32_t		gs_return_value;
10137c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
10147c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
10157c478bd9Sstevel@tonic-gate 	size32_t		gs_size;
10167c478bd9Sstevel@tonic-gate } crypto_object_get_size32_t;
10177c478bd9Sstevel@tonic-gate 
10187c478bd9Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value32 {
10197c478bd9Sstevel@tonic-gate 	uint32_t		sa_return_value;
10207c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
10217c478bd9Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
10227c478bd9Sstevel@tonic-gate 	uint32_t		sa_count;
10237c478bd9Sstevel@tonic-gate 	caddr32_t		sa_attributes;
10247c478bd9Sstevel@tonic-gate } crypto_object_set_attribute_value32_t;
10257c478bd9Sstevel@tonic-gate 
10267c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_init32 {
10277c478bd9Sstevel@tonic-gate 	uint32_t		fi_return_value;
10287c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
10297c478bd9Sstevel@tonic-gate 	uint32_t		fi_count;
10307c478bd9Sstevel@tonic-gate 	caddr32_t		fi_attributes;
10317c478bd9Sstevel@tonic-gate } crypto_object_find_init32_t;
10327c478bd9Sstevel@tonic-gate 
10337c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_update32 {
10347c478bd9Sstevel@tonic-gate 	uint32_t		fu_return_value;
10357c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
10367c478bd9Sstevel@tonic-gate 	uint32_t		fu_max_count;
10377c478bd9Sstevel@tonic-gate 	uint32_t		fu_count;
10387c478bd9Sstevel@tonic-gate 	caddr32_t		fu_handles;
10397c478bd9Sstevel@tonic-gate } crypto_object_find_update32_t;
10407c478bd9Sstevel@tonic-gate 
10417c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_final32 {
10427c478bd9Sstevel@tonic-gate 	uint32_t		ff_return_value;
10437c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
10447c478bd9Sstevel@tonic-gate } crypto_object_find_final32_t;
10457c478bd9Sstevel@tonic-gate 
10467c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
10477c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
10487c478bd9Sstevel@tonic-gate 
10497c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_CREATE			CRYPTO(100)
10507c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_COPY			CRYPTO(101)
10517c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_DESTROY			CRYPTO(102)
10527c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE	CRYPTO(103)
10537c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_SIZE			CRYPTO(104)
10547c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE	CRYPTO(105)
10557c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_INIT			CRYPTO(106)
10567c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_UPDATE		CRYPTO(107)
10577c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_FINAL		CRYPTO(108)
10587c478bd9Sstevel@tonic-gate 
10597c478bd9Sstevel@tonic-gate /*
10607c478bd9Sstevel@tonic-gate  * Key Generation Ioctls
10617c478bd9Sstevel@tonic-gate  */
10627c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key {
10637c478bd9Sstevel@tonic-gate 	uint_t			gk_return_value;
10647c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
10657c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
10667c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	gk_mechanism;
10677c478bd9Sstevel@tonic-gate 	uint_t			gk_count;
10687c478bd9Sstevel@tonic-gate 	caddr_t			gk_attributes;
10697c478bd9Sstevel@tonic-gate } crypto_object_generate_key_t;
10707c478bd9Sstevel@tonic-gate 
10717c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair {
10727c478bd9Sstevel@tonic-gate 	uint_t			kp_return_value;
10737c478bd9Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
10747c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
10757c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
10767c478bd9Sstevel@tonic-gate 	uint_t			kp_public_count;
10777c478bd9Sstevel@tonic-gate 	uint_t			kp_private_count;
10787c478bd9Sstevel@tonic-gate 	caddr_t			kp_public_attributes;
10797c478bd9Sstevel@tonic-gate 	caddr_t			kp_private_attributes;
10807c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	kp_mechanism;
10817c478bd9Sstevel@tonic-gate } crypto_object_generate_key_pair_t;
10827c478bd9Sstevel@tonic-gate 
10837c478bd9Sstevel@tonic-gate typedef struct crypto_object_wrap_key {
10847c478bd9Sstevel@tonic-gate 	uint_t			wk_return_value;
10857c478bd9Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
10867c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	wk_mechanism;
10877c478bd9Sstevel@tonic-gate 	crypto_key_t		wk_wrapping_key;
10887c478bd9Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
10897c478bd9Sstevel@tonic-gate 	size_t			wk_wrapped_key_len;
10907c478bd9Sstevel@tonic-gate 	caddr_t			wk_wrapped_key;
10917c478bd9Sstevel@tonic-gate } crypto_object_wrap_key_t;
10927c478bd9Sstevel@tonic-gate 
10937c478bd9Sstevel@tonic-gate typedef struct crypto_object_unwrap_key {
10947c478bd9Sstevel@tonic-gate 	uint_t			uk_return_value;
10957c478bd9Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
10967c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	uk_mechanism;
10977c478bd9Sstevel@tonic-gate 	crypto_key_t		uk_unwrapping_key;
10987c478bd9Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
10997c478bd9Sstevel@tonic-gate 	size_t			uk_wrapped_key_len;
11007c478bd9Sstevel@tonic-gate 	caddr_t			uk_wrapped_key;
11017c478bd9Sstevel@tonic-gate 	uint_t			uk_count;
11027c478bd9Sstevel@tonic-gate 	caddr_t			uk_attributes;
11037c478bd9Sstevel@tonic-gate } crypto_object_unwrap_key_t;
11047c478bd9Sstevel@tonic-gate 
11057c478bd9Sstevel@tonic-gate typedef struct crypto_derive_key {
11067c478bd9Sstevel@tonic-gate 	uint_t			dk_return_value;
11077c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
11087c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	dk_mechanism;
11097c478bd9Sstevel@tonic-gate 	crypto_key_t		dk_base_key;
11107c478bd9Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
11117c478bd9Sstevel@tonic-gate 	uint_t			dk_count;
11127c478bd9Sstevel@tonic-gate 	caddr_t			dk_attributes;
11137c478bd9Sstevel@tonic-gate } crypto_derive_key_t;
11147c478bd9Sstevel@tonic-gate 
11157c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
11167c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
11177c478bd9Sstevel@tonic-gate 
11187c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
11197c478bd9Sstevel@tonic-gate #pragma pack(4)
11207c478bd9Sstevel@tonic-gate #endif
11217c478bd9Sstevel@tonic-gate 
11227c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key32 {
11237c478bd9Sstevel@tonic-gate 	uint32_t		gk_return_value;
11247c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
11257c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
11267c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	gk_mechanism;
11277c478bd9Sstevel@tonic-gate 	uint32_t		gk_count;
11287c478bd9Sstevel@tonic-gate 	caddr32_t		gk_attributes;
11297c478bd9Sstevel@tonic-gate } crypto_object_generate_key32_t;
11307c478bd9Sstevel@tonic-gate 
11317c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
11327c478bd9Sstevel@tonic-gate #pragma pack()
11337c478bd9Sstevel@tonic-gate #endif
11347c478bd9Sstevel@tonic-gate 
11357c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair32 {
11367c478bd9Sstevel@tonic-gate 	uint32_t		kp_return_value;
11377c478bd9Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
11387c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
11397c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
11407c478bd9Sstevel@tonic-gate 	uint32_t		kp_public_count;
11417c478bd9Sstevel@tonic-gate 	uint32_t		kp_private_count;
11427c478bd9Sstevel@tonic-gate 	caddr32_t		kp_public_attributes;
11437c478bd9Sstevel@tonic-gate 	caddr32_t		kp_private_attributes;
11447c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	kp_mechanism;
11457c478bd9Sstevel@tonic-gate } crypto_object_generate_key_pair32_t;
11467c478bd9Sstevel@tonic-gate 
11477c478bd9Sstevel@tonic-gate typedef struct crypto_object_wrap_key32 {
11487c478bd9Sstevel@tonic-gate 	uint32_t		wk_return_value;
11497c478bd9Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
11507c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	wk_mechanism;
11517c478bd9Sstevel@tonic-gate 	crypto_key32_t		wk_wrapping_key;
11527c478bd9Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
11537c478bd9Sstevel@tonic-gate 	size32_t		wk_wrapped_key_len;
11547c478bd9Sstevel@tonic-gate 	caddr32_t		wk_wrapped_key;
11557c478bd9Sstevel@tonic-gate } crypto_object_wrap_key32_t;
11567c478bd9Sstevel@tonic-gate 
11577c478bd9Sstevel@tonic-gate typedef struct crypto_object_unwrap_key32 {
11587c478bd9Sstevel@tonic-gate 	uint32_t		uk_return_value;
11597c478bd9Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
11607c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	uk_mechanism;
11617c478bd9Sstevel@tonic-gate 	crypto_key32_t		uk_unwrapping_key;
11627c478bd9Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
11637c478bd9Sstevel@tonic-gate 	size32_t		uk_wrapped_key_len;
11647c478bd9Sstevel@tonic-gate 	caddr32_t		uk_wrapped_key;
11657c478bd9Sstevel@tonic-gate 	uint32_t		uk_count;
11667c478bd9Sstevel@tonic-gate 	caddr32_t		uk_attributes;
11677c478bd9Sstevel@tonic-gate } crypto_object_unwrap_key32_t;
11687c478bd9Sstevel@tonic-gate 
11697c478bd9Sstevel@tonic-gate typedef struct crypto_derive_key32 {
11707c478bd9Sstevel@tonic-gate 	uint32_t		dk_return_value;
11717c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
11727c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	dk_mechanism;
11737c478bd9Sstevel@tonic-gate 	crypto_key32_t		dk_base_key;
11747c478bd9Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
11757c478bd9Sstevel@tonic-gate 	uint32_t		dk_count;
11767c478bd9Sstevel@tonic-gate 	caddr32_t		dk_attributes;
11777c478bd9Sstevel@tonic-gate } crypto_derive_key32_t;
11787c478bd9Sstevel@tonic-gate 
11797c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
11807c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
11817c478bd9Sstevel@tonic-gate 
11827c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY		CRYPTO(110)
11837c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY_PAIR	CRYPTO(111)
11847c478bd9Sstevel@tonic-gate #define	CRYPTO_WRAP_KEY			CRYPTO(112)
11857c478bd9Sstevel@tonic-gate #define	CRYPTO_UNWRAP_KEY		CRYPTO(113)
11867c478bd9Sstevel@tonic-gate #define	CRYPTO_DERIVE_KEY		CRYPTO(114)
11877c478bd9Sstevel@tonic-gate 
11887c478bd9Sstevel@tonic-gate /*
11897c478bd9Sstevel@tonic-gate  * Provider Management Ioctls
11907c478bd9Sstevel@tonic-gate  */
11917c478bd9Sstevel@tonic-gate 
11927c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_list {
11937c478bd9Sstevel@tonic-gate 	uint_t			pl_return_value;
11947c478bd9Sstevel@tonic-gate 	uint_t			pl_count;
11957c478bd9Sstevel@tonic-gate 	crypto_provider_entry_t	pl_list[1];
11967c478bd9Sstevel@tonic-gate } crypto_get_provider_list_t;
11977c478bd9Sstevel@tonic-gate 
11987c478bd9Sstevel@tonic-gate typedef struct crypto_provider_data {
11997c478bd9Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
12007c478bd9Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
12017c478bd9Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
12027c478bd9Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
12037c478bd9Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
12047c478bd9Sstevel@tonic-gate 	ulong_t			pd_flags;
12057c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_session_count;
12067c478bd9Sstevel@tonic-gate 	ulong_t			pd_session_count;
12077c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_rw_session_count;
12087c478bd9Sstevel@tonic-gate 	ulong_t			pd_rw_session_count;
12097c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_pin_len;
12107c478bd9Sstevel@tonic-gate 	ulong_t			pd_min_pin_len;
12117c478bd9Sstevel@tonic-gate 	ulong_t			pd_total_public_memory;
12127c478bd9Sstevel@tonic-gate 	ulong_t			pd_free_public_memory;
12137c478bd9Sstevel@tonic-gate 	ulong_t			pd_total_private_memory;
12147c478bd9Sstevel@tonic-gate 	ulong_t			pd_free_private_memory;
12157c478bd9Sstevel@tonic-gate 	crypto_version_t	pd_hardware_version;
12167c478bd9Sstevel@tonic-gate 	crypto_version_t	pd_firmware_version;
12177c478bd9Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
12187c478bd9Sstevel@tonic-gate } crypto_provider_data_t;
12197c478bd9Sstevel@tonic-gate 
12207c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_info {
12217c478bd9Sstevel@tonic-gate 	uint_t			gi_return_value;
12227c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
12237c478bd9Sstevel@tonic-gate 	crypto_provider_data_t	gi_provider_data;
12247c478bd9Sstevel@tonic-gate } crypto_get_provider_info_t;
12257c478bd9Sstevel@tonic-gate 
12267c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms {
12277c478bd9Sstevel@tonic-gate 	uint_t			pm_return_value;
12287c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
12297c478bd9Sstevel@tonic-gate 	uint_t			pm_count;
12307c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
12317c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanisms_t;
12327c478bd9Sstevel@tonic-gate 
12337c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanism_info {
12347c478bd9Sstevel@tonic-gate 	uint_t			mi_return_value;
12357c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	mi_provider_id;
12367c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	mi_mechanism_name;
12377c478bd9Sstevel@tonic-gate 	uint32_t		mi_min_key_size;
12387c478bd9Sstevel@tonic-gate 	uint32_t		mi_max_key_size;
12397c478bd9Sstevel@tonic-gate 	uint32_t		mi_flags;
12407c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanism_info_t;
12417c478bd9Sstevel@tonic-gate 
12427c478bd9Sstevel@tonic-gate typedef struct crypto_init_token {
12437c478bd9Sstevel@tonic-gate 	uint_t			it_return_value;
12447c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
12457c478bd9Sstevel@tonic-gate 	caddr_t			it_pin;
12467c478bd9Sstevel@tonic-gate 	size_t			it_pin_len;
12477c478bd9Sstevel@tonic-gate 	caddr_t			it_label;
12487c478bd9Sstevel@tonic-gate } crypto_init_token_t;
12497c478bd9Sstevel@tonic-gate 
12507c478bd9Sstevel@tonic-gate typedef struct crypto_init_pin {
12517c478bd9Sstevel@tonic-gate 	uint_t			ip_return_value;
12527c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
12537c478bd9Sstevel@tonic-gate 	caddr_t			ip_pin;
12547c478bd9Sstevel@tonic-gate 	size_t			ip_pin_len;
12557c478bd9Sstevel@tonic-gate } crypto_init_pin_t;
12567c478bd9Sstevel@tonic-gate 
12577c478bd9Sstevel@tonic-gate typedef struct crypto_set_pin {
12587c478bd9Sstevel@tonic-gate 	uint_t			sp_return_value;
12597c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
12607c478bd9Sstevel@tonic-gate 	caddr_t			sp_old_pin;
12617c478bd9Sstevel@tonic-gate 	size_t			sp_old_len;
12627c478bd9Sstevel@tonic-gate 	caddr_t			sp_new_pin;
12637c478bd9Sstevel@tonic-gate 	size_t			sp_new_len;
12647c478bd9Sstevel@tonic-gate } crypto_set_pin_t;
12657c478bd9Sstevel@tonic-gate 
12667c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
12677c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
12687c478bd9Sstevel@tonic-gate 
12697c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_list32 {
12707c478bd9Sstevel@tonic-gate 	uint32_t		pl_return_value;
12717c478bd9Sstevel@tonic-gate 	uint32_t		pl_count;
12727c478bd9Sstevel@tonic-gate 	crypto_provider_entry_t pl_list[1];
12737c478bd9Sstevel@tonic-gate } crypto_get_provider_list32_t;
12747c478bd9Sstevel@tonic-gate 
12757c478bd9Sstevel@tonic-gate typedef struct crypto_version32 {
12767c478bd9Sstevel@tonic-gate 	uchar_t	cv_major;
12777c478bd9Sstevel@tonic-gate 	uchar_t	cv_minor;
12787c478bd9Sstevel@tonic-gate } crypto_version32_t;
12797c478bd9Sstevel@tonic-gate 
12807c478bd9Sstevel@tonic-gate typedef struct crypto_provider_data32 {
12817c478bd9Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
12827c478bd9Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
12837c478bd9Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
12847c478bd9Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
12857c478bd9Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
12867c478bd9Sstevel@tonic-gate 	uint32_t		pd_flags;
12877c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_session_count;
12887c478bd9Sstevel@tonic-gate 	uint32_t		pd_session_count;
12897c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_rw_session_count;
12907c478bd9Sstevel@tonic-gate 	uint32_t		pd_rw_session_count;
12917c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_pin_len;
12927c478bd9Sstevel@tonic-gate 	uint32_t		pd_min_pin_len;
12937c478bd9Sstevel@tonic-gate 	uint32_t		pd_total_public_memory;
12947c478bd9Sstevel@tonic-gate 	uint32_t		pd_free_public_memory;
12957c478bd9Sstevel@tonic-gate 	uint32_t		pd_total_private_memory;
12967c478bd9Sstevel@tonic-gate 	uint32_t		pd_free_private_memory;
12977c478bd9Sstevel@tonic-gate 	crypto_version32_t	pd_hardware_version;
12987c478bd9Sstevel@tonic-gate 	crypto_version32_t	pd_firmware_version;
12997c478bd9Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
13007c478bd9Sstevel@tonic-gate } crypto_provider_data32_t;
13017c478bd9Sstevel@tonic-gate 
13027c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_info32 {
13037c478bd9Sstevel@tonic-gate 	uint32_t		gi_return_value;
13047c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
13057c478bd9Sstevel@tonic-gate 	crypto_provider_data32_t gi_provider_data;
13067c478bd9Sstevel@tonic-gate } crypto_get_provider_info32_t;
13077c478bd9Sstevel@tonic-gate 
13087c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms32 {
13097c478bd9Sstevel@tonic-gate 	uint32_t		pm_return_value;
13107c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
13117c478bd9Sstevel@tonic-gate 	uint32_t		pm_count;
13127c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
13137c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanisms32_t;
13147c478bd9Sstevel@tonic-gate 
13157c478bd9Sstevel@tonic-gate typedef struct crypto_init_token32 {
13167c478bd9Sstevel@tonic-gate 	uint32_t		it_return_value;
13177c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
13187c478bd9Sstevel@tonic-gate 	caddr32_t		it_pin;
13197c478bd9Sstevel@tonic-gate 	size32_t		it_pin_len;
13207c478bd9Sstevel@tonic-gate 	caddr32_t		it_label;
13217c478bd9Sstevel@tonic-gate } crypto_init_token32_t;
13227c478bd9Sstevel@tonic-gate 
13237c478bd9Sstevel@tonic-gate typedef struct crypto_init_pin32 {
13247c478bd9Sstevel@tonic-gate 	uint32_t		ip_return_value;
13257c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
13267c478bd9Sstevel@tonic-gate 	caddr32_t		ip_pin;
13277c478bd9Sstevel@tonic-gate 	size32_t		ip_pin_len;
13287c478bd9Sstevel@tonic-gate } crypto_init_pin32_t;
13297c478bd9Sstevel@tonic-gate 
13307c478bd9Sstevel@tonic-gate typedef struct crypto_set_pin32 {
13317c478bd9Sstevel@tonic-gate 	uint32_t		sp_return_value;
13327c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
13337c478bd9Sstevel@tonic-gate 	caddr32_t		sp_old_pin;
13347c478bd9Sstevel@tonic-gate 	size32_t		sp_old_len;
13357c478bd9Sstevel@tonic-gate 	caddr32_t		sp_new_pin;
13367c478bd9Sstevel@tonic-gate 	size32_t		sp_new_len;
13377c478bd9Sstevel@tonic-gate } crypto_set_pin32_t;
13387c478bd9Sstevel@tonic-gate 
13397c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
13407c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
13417c478bd9Sstevel@tonic-gate 
13427c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_LIST		CRYPTO(120)
13437c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_INFO		CRYPTO(121)
13447c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISMS		CRYPTO(122)
13457c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISM_INFO	CRYPTO(123)
13467c478bd9Sstevel@tonic-gate #define	CRYPTO_INIT_TOKEN			CRYPTO(124)
13477c478bd9Sstevel@tonic-gate #define	CRYPTO_INIT_PIN				CRYPTO(125)
13487c478bd9Sstevel@tonic-gate #define	CRYPTO_SET_PIN				CRYPTO(126)
13497c478bd9Sstevel@tonic-gate 
1350034448feSmcpowers /*
1351034448feSmcpowers  * No (Key) Store Key Generation Ioctls
1352034448feSmcpowers  */
1353034448feSmcpowers typedef struct crypto_nostore_generate_key {
1354034448feSmcpowers 	uint_t			ngk_return_value;
1355034448feSmcpowers 	crypto_session_id_t	ngk_session;
1356034448feSmcpowers 	crypto_mechanism_t	ngk_mechanism;
1357034448feSmcpowers 	uint_t			ngk_in_count;
1358034448feSmcpowers 	uint_t			ngk_out_count;
1359034448feSmcpowers 	caddr_t			ngk_in_attributes;
1360034448feSmcpowers 	caddr_t			ngk_out_attributes;
1361034448feSmcpowers } crypto_nostore_generate_key_t;
1362034448feSmcpowers 
1363034448feSmcpowers typedef struct crypto_nostore_generate_key_pair {
1364034448feSmcpowers 	uint_t			nkp_return_value;
1365034448feSmcpowers 	crypto_session_id_t	nkp_session;
1366034448feSmcpowers 	uint_t			nkp_in_public_count;
1367034448feSmcpowers 	uint_t			nkp_in_private_count;
1368034448feSmcpowers 	uint_t			nkp_out_public_count;
1369034448feSmcpowers 	uint_t			nkp_out_private_count;
1370034448feSmcpowers 	caddr_t			nkp_in_public_attributes;
1371034448feSmcpowers 	caddr_t			nkp_in_private_attributes;
1372034448feSmcpowers 	caddr_t			nkp_out_public_attributes;
1373034448feSmcpowers 	caddr_t			nkp_out_private_attributes;
1374034448feSmcpowers 	crypto_mechanism_t	nkp_mechanism;
1375034448feSmcpowers } crypto_nostore_generate_key_pair_t;
1376034448feSmcpowers 
1377034448feSmcpowers typedef struct crypto_nostore_derive_key {
1378034448feSmcpowers 	uint_t			ndk_return_value;
1379034448feSmcpowers 	crypto_session_id_t	ndk_session;
1380034448feSmcpowers 	crypto_mechanism_t	ndk_mechanism;
1381034448feSmcpowers 	crypto_key_t		ndk_base_key;
1382034448feSmcpowers 	uint_t			ndk_in_count;
1383034448feSmcpowers 	uint_t			ndk_out_count;
1384034448feSmcpowers 	caddr_t			ndk_in_attributes;
1385034448feSmcpowers 	caddr_t			ndk_out_attributes;
1386034448feSmcpowers } crypto_nostore_derive_key_t;
1387034448feSmcpowers 
1388034448feSmcpowers #ifdef	_KERNEL
1389034448feSmcpowers #ifdef	_SYSCALL32
1390034448feSmcpowers 
1391034448feSmcpowers typedef struct crypto_nostore_generate_key32 {
1392034448feSmcpowers 	uint32_t		ngk_return_value;
1393034448feSmcpowers 	crypto_session_id_t	ngk_session;
1394034448feSmcpowers 	crypto_mechanism32_t	ngk_mechanism;
1395034448feSmcpowers 	uint32_t		ngk_in_count;
1396034448feSmcpowers 	uint32_t		ngk_out_count;
1397034448feSmcpowers 	caddr32_t		ngk_in_attributes;
1398034448feSmcpowers 	caddr32_t		ngk_out_attributes;
1399034448feSmcpowers } crypto_nostore_generate_key32_t;
1400034448feSmcpowers 
1401034448feSmcpowers typedef struct crypto_nostore_generate_key_pair32 {
1402034448feSmcpowers 	uint32_t		nkp_return_value;
1403034448feSmcpowers 	crypto_session_id_t	nkp_session;
1404034448feSmcpowers 	uint32_t		nkp_in_public_count;
1405034448feSmcpowers 	uint32_t		nkp_in_private_count;
1406034448feSmcpowers 	uint32_t		nkp_out_public_count;
1407034448feSmcpowers 	uint32_t		nkp_out_private_count;
1408034448feSmcpowers 	caddr32_t		nkp_in_public_attributes;
1409034448feSmcpowers 	caddr32_t		nkp_in_private_attributes;
1410034448feSmcpowers 	caddr32_t		nkp_out_public_attributes;
1411034448feSmcpowers 	caddr32_t		nkp_out_private_attributes;
1412034448feSmcpowers 	crypto_mechanism32_t	nkp_mechanism;
1413034448feSmcpowers } crypto_nostore_generate_key_pair32_t;
1414034448feSmcpowers 
1415034448feSmcpowers #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1416034448feSmcpowers #pragma pack(4)
1417034448feSmcpowers #endif
1418034448feSmcpowers 
1419034448feSmcpowers typedef struct crypto_nostore_derive_key32 {
1420034448feSmcpowers 	uint32_t		ndk_return_value;
1421034448feSmcpowers 	crypto_session_id_t	ndk_session;
1422034448feSmcpowers 	crypto_mechanism32_t	ndk_mechanism;
1423034448feSmcpowers 	crypto_key32_t		ndk_base_key;
1424034448feSmcpowers 	uint32_t		ndk_in_count;
1425034448feSmcpowers 	uint32_t		ndk_out_count;
1426034448feSmcpowers 	caddr32_t		ndk_in_attributes;
1427034448feSmcpowers 	caddr32_t		ndk_out_attributes;
1428034448feSmcpowers } crypto_nostore_derive_key32_t;
1429034448feSmcpowers 
1430034448feSmcpowers #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1431034448feSmcpowers #pragma pack()
1432034448feSmcpowers #endif
1433034448feSmcpowers 
1434034448feSmcpowers #endif	/* _SYSCALL32 */
1435034448feSmcpowers #endif	/* _KERNEL */
1436034448feSmcpowers 
1437034448feSmcpowers #define	CRYPTO_NOSTORE_GENERATE_KEY		CRYPTO(127)
1438034448feSmcpowers #define	CRYPTO_NOSTORE_GENERATE_KEY_PAIR	CRYPTO(128)
1439034448feSmcpowers #define	CRYPTO_NOSTORE_DERIVE_KEY		CRYPTO(129)
1440034448feSmcpowers 
14417c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
14427c478bd9Sstevel@tonic-gate }
14437c478bd9Sstevel@tonic-gate #endif
14447c478bd9Sstevel@tonic-gate 
14457c478bd9Sstevel@tonic-gate #endif	/* _SYS_CRYPTO_IOCTL_H */
1446