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