xref: /illumos-gate/usr/src/uts/common/sys/crypto/ioctl.h (revision ba5f469c0173c4d47f377c20b530f5be165d49dc)
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  */
21*ba5f469cSkrishna 
227c478bd9Sstevel@tonic-gate /*
23*ba5f469cSkrishna  * 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;
118*ba5f469cSkrishna 
119*ba5f469cSkrishna 	boolean_t prov_is_limited;
120*ba5f469cSkrishna 	uint32_t prov_hash_threshold;
121*ba5f469cSkrishna 	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 
2267c478bd9Sstevel@tonic-gate /*
2277c478bd9Sstevel@tonic-gate  * Cryptographic Ioctls
2287c478bd9Sstevel@tonic-gate  */
2297c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt {
2307c478bd9Sstevel@tonic-gate 	uint_t			ce_return_value;
2317c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
2327c478bd9Sstevel@tonic-gate 	size_t			ce_datalen;
2337c478bd9Sstevel@tonic-gate 	caddr_t			ce_databuf;
2347c478bd9Sstevel@tonic-gate 	size_t			ce_encrlen;
2357c478bd9Sstevel@tonic-gate 	caddr_t			ce_encrbuf;
2367c478bd9Sstevel@tonic-gate } crypto_encrypt_t;
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_init {
2397c478bd9Sstevel@tonic-gate 	uint_t			ei_return_value;
2407c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
2417c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ei_mech;
2427c478bd9Sstevel@tonic-gate 	crypto_key_t		ei_key;
2437c478bd9Sstevel@tonic-gate } crypto_encrypt_init_t;
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_update {
2467c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
2477c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
2487c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
2497c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
2507c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
2517c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
2527c478bd9Sstevel@tonic-gate } crypto_encrypt_update_t;
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_final {
2557c478bd9Sstevel@tonic-gate 	uint_t			ef_return_value;
2567c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
2577c478bd9Sstevel@tonic-gate 	size_t			ef_encrlen;
2587c478bd9Sstevel@tonic-gate 	caddr_t			ef_encrbuf;
2597c478bd9Sstevel@tonic-gate } crypto_encrypt_final_t;
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt {
2627c478bd9Sstevel@tonic-gate 	uint_t			cd_return_value;
2637c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
2647c478bd9Sstevel@tonic-gate 	size_t			cd_encrlen;
2657c478bd9Sstevel@tonic-gate 	caddr_t			cd_encrbuf;
2667c478bd9Sstevel@tonic-gate 	size_t			cd_datalen;
2677c478bd9Sstevel@tonic-gate 	caddr_t			cd_databuf;
2687c478bd9Sstevel@tonic-gate } crypto_decrypt_t;
2697c478bd9Sstevel@tonic-gate 
2707c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_init {
2717c478bd9Sstevel@tonic-gate 	uint_t			di_return_value;
2727c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
2737c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
2747c478bd9Sstevel@tonic-gate 	crypto_key_t		di_key;
2757c478bd9Sstevel@tonic-gate } crypto_decrypt_init_t;
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_update {
2787c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
2797c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
2807c478bd9Sstevel@tonic-gate 	size_t			du_encrlen;
2817c478bd9Sstevel@tonic-gate 	caddr_t			du_encrbuf;
2827c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
2837c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
2847c478bd9Sstevel@tonic-gate } crypto_decrypt_update_t;
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_final {
2877c478bd9Sstevel@tonic-gate 	uint_t			df_return_value;
2887c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
2897c478bd9Sstevel@tonic-gate 	size_t			df_datalen;
2907c478bd9Sstevel@tonic-gate 	caddr_t			df_databuf;
2917c478bd9Sstevel@tonic-gate } crypto_decrypt_final_t;
2927c478bd9Sstevel@tonic-gate 
2937c478bd9Sstevel@tonic-gate typedef struct crypto_digest {
2947c478bd9Sstevel@tonic-gate 	uint_t			cd_return_value;
2957c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
2967c478bd9Sstevel@tonic-gate 	size_t			cd_datalen;
2977c478bd9Sstevel@tonic-gate 	caddr_t			cd_databuf;
2987c478bd9Sstevel@tonic-gate 	size_t			cd_digestlen;
2997c478bd9Sstevel@tonic-gate 	caddr_t			cd_digestbuf;
3007c478bd9Sstevel@tonic-gate } crypto_digest_t;
3017c478bd9Sstevel@tonic-gate 
3027c478bd9Sstevel@tonic-gate typedef struct crypto_digest_init {
3037c478bd9Sstevel@tonic-gate 	uint_t			di_return_value;
3047c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
3057c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
3067c478bd9Sstevel@tonic-gate } crypto_digest_init_t;
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate typedef struct crypto_digest_update {
3097c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
3107c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
3117c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
3127c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
3137c478bd9Sstevel@tonic-gate } crypto_digest_update_t;
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate typedef struct crypto_digest_key {
3167c478bd9Sstevel@tonic-gate 	uint_t			dk_return_value;
3177c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
3187c478bd9Sstevel@tonic-gate 	crypto_key_t		dk_key;
3197c478bd9Sstevel@tonic-gate } crypto_digest_key_t;
3207c478bd9Sstevel@tonic-gate 
3217c478bd9Sstevel@tonic-gate typedef struct crypto_digest_final {
3227c478bd9Sstevel@tonic-gate 	uint_t			df_return_value;
3237c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
3247c478bd9Sstevel@tonic-gate 	size_t			df_digestlen;
3257c478bd9Sstevel@tonic-gate 	caddr_t			df_digestbuf;
3267c478bd9Sstevel@tonic-gate } crypto_digest_final_t;
3277c478bd9Sstevel@tonic-gate 
3287c478bd9Sstevel@tonic-gate typedef struct crypto_mac {
3297c478bd9Sstevel@tonic-gate 	uint_t			cm_return_value;
3307c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
3317c478bd9Sstevel@tonic-gate 	size_t			cm_datalen;
3327c478bd9Sstevel@tonic-gate 	caddr_t			cm_databuf;
3337c478bd9Sstevel@tonic-gate 	size_t			cm_maclen;
3347c478bd9Sstevel@tonic-gate 	caddr_t			cm_macbuf;
3357c478bd9Sstevel@tonic-gate } crypto_mac_t;
3367c478bd9Sstevel@tonic-gate 
3377c478bd9Sstevel@tonic-gate typedef struct crypto_mac_init {
3387c478bd9Sstevel@tonic-gate 	uint_t			mi_return_value;
3397c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
3407c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	mi_mech;
3417c478bd9Sstevel@tonic-gate 	crypto_key_t		mi_key;
3427c478bd9Sstevel@tonic-gate } crypto_mac_init_t;
3437c478bd9Sstevel@tonic-gate 
3447c478bd9Sstevel@tonic-gate typedef struct crypto_mac_update {
3457c478bd9Sstevel@tonic-gate 	uint_t			mu_return_value;
3467c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
3477c478bd9Sstevel@tonic-gate 	size_t			mu_datalen;
3487c478bd9Sstevel@tonic-gate 	caddr_t			mu_databuf;
3497c478bd9Sstevel@tonic-gate } crypto_mac_update_t;
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate typedef struct crypto_mac_final {
3527c478bd9Sstevel@tonic-gate 	uint_t			mf_return_value;
3537c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
3547c478bd9Sstevel@tonic-gate 	size_t			mf_maclen;
3557c478bd9Sstevel@tonic-gate 	caddr_t			mf_macbuf;
3567c478bd9Sstevel@tonic-gate } crypto_mac_final_t;
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate typedef struct crypto_sign {
3597c478bd9Sstevel@tonic-gate 	uint_t			cs_return_value;
3607c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
3617c478bd9Sstevel@tonic-gate 	size_t			cs_datalen;
3627c478bd9Sstevel@tonic-gate 	caddr_t			cs_databuf;
3637c478bd9Sstevel@tonic-gate 	size_t			cs_signlen;
3647c478bd9Sstevel@tonic-gate 	caddr_t			cs_signbuf;
3657c478bd9Sstevel@tonic-gate } crypto_sign_t;
3667c478bd9Sstevel@tonic-gate 
3677c478bd9Sstevel@tonic-gate typedef struct crypto_sign_init {
3687c478bd9Sstevel@tonic-gate 	uint_t			si_return_value;
3697c478bd9Sstevel@tonic-gate 	crypto_session_id_t	si_session;
3707c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	si_mech;
3717c478bd9Sstevel@tonic-gate 	crypto_key_t		si_key;
3727c478bd9Sstevel@tonic-gate } crypto_sign_init_t;
3737c478bd9Sstevel@tonic-gate 
3747c478bd9Sstevel@tonic-gate typedef struct crypto_sign_update {
3757c478bd9Sstevel@tonic-gate 	uint_t			su_return_value;
3767c478bd9Sstevel@tonic-gate 	crypto_session_id_t	su_session;
3777c478bd9Sstevel@tonic-gate 	size_t			su_datalen;
3787c478bd9Sstevel@tonic-gate 	caddr_t			su_databuf;
3797c478bd9Sstevel@tonic-gate } crypto_sign_update_t;
3807c478bd9Sstevel@tonic-gate 
3817c478bd9Sstevel@tonic-gate typedef struct crypto_sign_final {
3827c478bd9Sstevel@tonic-gate 	uint_t			sf_return_value;
3837c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
3847c478bd9Sstevel@tonic-gate 	size_t			sf_signlen;
3857c478bd9Sstevel@tonic-gate 	caddr_t			sf_signbuf;
3867c478bd9Sstevel@tonic-gate } crypto_sign_final_t;
3877c478bd9Sstevel@tonic-gate 
3887c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover_init {
3897c478bd9Sstevel@tonic-gate 	uint_t			ri_return_value;
3907c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
3917c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
3927c478bd9Sstevel@tonic-gate 	crypto_key_t		ri_key;
3937c478bd9Sstevel@tonic-gate } crypto_sign_recover_init_t;
3947c478bd9Sstevel@tonic-gate 
3957c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover {
3967c478bd9Sstevel@tonic-gate 	uint_t			sr_return_value;
3977c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
3987c478bd9Sstevel@tonic-gate 	size_t			sr_datalen;
3997c478bd9Sstevel@tonic-gate 	caddr_t			sr_databuf;
4007c478bd9Sstevel@tonic-gate 	size_t			sr_signlen;
4017c478bd9Sstevel@tonic-gate 	caddr_t			sr_signbuf;
4027c478bd9Sstevel@tonic-gate } crypto_sign_recover_t;
4037c478bd9Sstevel@tonic-gate 
4047c478bd9Sstevel@tonic-gate typedef struct crypto_verify {
4057c478bd9Sstevel@tonic-gate 	uint_t			cv_return_value;
4067c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
4077c478bd9Sstevel@tonic-gate 	size_t			cv_datalen;
4087c478bd9Sstevel@tonic-gate 	caddr_t			cv_databuf;
4097c478bd9Sstevel@tonic-gate 	size_t			cv_signlen;
4107c478bd9Sstevel@tonic-gate 	caddr_t			cv_signbuf;
4117c478bd9Sstevel@tonic-gate } crypto_verify_t;
4127c478bd9Sstevel@tonic-gate 
4137c478bd9Sstevel@tonic-gate typedef struct crypto_verify_init {
4147c478bd9Sstevel@tonic-gate 	uint_t			vi_return_value;
4157c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
4167c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	vi_mech;
4177c478bd9Sstevel@tonic-gate 	crypto_key_t		vi_key;
4187c478bd9Sstevel@tonic-gate } crypto_verify_init_t;
4197c478bd9Sstevel@tonic-gate 
4207c478bd9Sstevel@tonic-gate typedef struct crypto_verify_update {
4217c478bd9Sstevel@tonic-gate 	uint_t			vu_return_value;
4227c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
4237c478bd9Sstevel@tonic-gate 	size_t			vu_datalen;
4247c478bd9Sstevel@tonic-gate 	caddr_t			vu_databuf;
4257c478bd9Sstevel@tonic-gate } crypto_verify_update_t;
4267c478bd9Sstevel@tonic-gate 
4277c478bd9Sstevel@tonic-gate typedef struct crypto_verify_final {
4287c478bd9Sstevel@tonic-gate 	uint_t			vf_return_value;
4297c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
4307c478bd9Sstevel@tonic-gate 	size_t			vf_signlen;
4317c478bd9Sstevel@tonic-gate 	caddr_t			vf_signbuf;
4327c478bd9Sstevel@tonic-gate } crypto_verify_final_t;
4337c478bd9Sstevel@tonic-gate 
4347c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover_init {
4357c478bd9Sstevel@tonic-gate 	uint_t			ri_return_value;
4367c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
4377c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
4387c478bd9Sstevel@tonic-gate 	crypto_key_t		ri_key;
4397c478bd9Sstevel@tonic-gate } crypto_verify_recover_init_t;
4407c478bd9Sstevel@tonic-gate 
4417c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover {
4427c478bd9Sstevel@tonic-gate 	uint_t			vr_return_value;
4437c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
4447c478bd9Sstevel@tonic-gate 	size_t			vr_signlen;
4457c478bd9Sstevel@tonic-gate 	caddr_t			vr_signbuf;
4467c478bd9Sstevel@tonic-gate 	size_t			vr_datalen;
4477c478bd9Sstevel@tonic-gate 	caddr_t			vr_databuf;
4487c478bd9Sstevel@tonic-gate } crypto_verify_recover_t;
4497c478bd9Sstevel@tonic-gate 
4507c478bd9Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update {
4517c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
4527c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4537c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
4547c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
4557c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
4567c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
4577c478bd9Sstevel@tonic-gate } crypto_digest_encrypt_update_t;
4587c478bd9Sstevel@tonic-gate 
4597c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update {
4607c478bd9Sstevel@tonic-gate 	uint_t			du_return_value;
4617c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
4627c478bd9Sstevel@tonic-gate 	size_t			du_encrlen;
4637c478bd9Sstevel@tonic-gate 	caddr_t			du_encrbuf;
4647c478bd9Sstevel@tonic-gate 	size_t			du_datalen;
4657c478bd9Sstevel@tonic-gate 	caddr_t			du_databuf;
4667c478bd9Sstevel@tonic-gate } crypto_decrypt_digest_update_t;
4677c478bd9Sstevel@tonic-gate 
4687c478bd9Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update {
4697c478bd9Sstevel@tonic-gate 	uint_t			eu_return_value;
4707c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4717c478bd9Sstevel@tonic-gate 	size_t			eu_datalen;
4727c478bd9Sstevel@tonic-gate 	caddr_t			eu_databuf;
4737c478bd9Sstevel@tonic-gate 	size_t			eu_encrlen;
4747c478bd9Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
4757c478bd9Sstevel@tonic-gate } crypto_sign_encrypt_update_t;
4767c478bd9Sstevel@tonic-gate 
4777c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update {
4787c478bd9Sstevel@tonic-gate 	uint_t			vu_return_value;
4797c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
4807c478bd9Sstevel@tonic-gate 	size_t			vu_encrlen;
4817c478bd9Sstevel@tonic-gate 	caddr_t			vu_encrbuf;
4827c478bd9Sstevel@tonic-gate 	size_t			vu_datalen;
4837c478bd9Sstevel@tonic-gate 	caddr_t			vu_databuf;
4847c478bd9Sstevel@tonic-gate } crypto_decrypt_verify_update_t;
4857c478bd9Sstevel@tonic-gate 
4867c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
4877c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
4887c478bd9Sstevel@tonic-gate 
4897c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt32 {
4907c478bd9Sstevel@tonic-gate 	uint32_t		ce_return_value;
4917c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
4927c478bd9Sstevel@tonic-gate 	size32_t		ce_datalen;
4937c478bd9Sstevel@tonic-gate 	caddr32_t		ce_databuf;
4947c478bd9Sstevel@tonic-gate 	size32_t		ce_encrlen;
4957c478bd9Sstevel@tonic-gate 	caddr32_t		ce_encrbuf;
4967c478bd9Sstevel@tonic-gate } crypto_encrypt32_t;
4977c478bd9Sstevel@tonic-gate 
4987c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
4997c478bd9Sstevel@tonic-gate #pragma pack(4)
5007c478bd9Sstevel@tonic-gate #endif
5017c478bd9Sstevel@tonic-gate 
5027c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_init32 {
5037c478bd9Sstevel@tonic-gate 	uint32_t		ei_return_value;
5047c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
5057c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ei_mech;
5067c478bd9Sstevel@tonic-gate 	crypto_key32_t		ei_key;
5077c478bd9Sstevel@tonic-gate } crypto_encrypt_init32_t;
5087c478bd9Sstevel@tonic-gate 
5097c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5107c478bd9Sstevel@tonic-gate #pragma pack()
5117c478bd9Sstevel@tonic-gate #endif
5127c478bd9Sstevel@tonic-gate 
5137c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_update32 {
5147c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
5157c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
5167c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
5177c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
5187c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
5197c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
5207c478bd9Sstevel@tonic-gate } crypto_encrypt_update32_t;
5217c478bd9Sstevel@tonic-gate 
5227c478bd9Sstevel@tonic-gate typedef struct crypto_encrypt_final32 {
5237c478bd9Sstevel@tonic-gate 	uint32_t		ef_return_value;
5247c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
5257c478bd9Sstevel@tonic-gate 	size32_t		ef_encrlen;
5267c478bd9Sstevel@tonic-gate 	caddr32_t		ef_encrbuf;
5277c478bd9Sstevel@tonic-gate } crypto_encrypt_final32_t;
5287c478bd9Sstevel@tonic-gate 
5297c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt32 {
5307c478bd9Sstevel@tonic-gate 	uint32_t		cd_return_value;
5317c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
5327c478bd9Sstevel@tonic-gate 	size32_t		cd_encrlen;
5337c478bd9Sstevel@tonic-gate 	caddr32_t		cd_encrbuf;
5347c478bd9Sstevel@tonic-gate 	size32_t		cd_datalen;
5357c478bd9Sstevel@tonic-gate 	caddr32_t		cd_databuf;
5367c478bd9Sstevel@tonic-gate } crypto_decrypt32_t;
5377c478bd9Sstevel@tonic-gate 
5387c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5397c478bd9Sstevel@tonic-gate #pragma pack(4)
5407c478bd9Sstevel@tonic-gate #endif
5417c478bd9Sstevel@tonic-gate 
5427c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_init32 {
5437c478bd9Sstevel@tonic-gate 	uint32_t		di_return_value;
5447c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
5457c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
5467c478bd9Sstevel@tonic-gate 	crypto_key32_t		di_key;
5477c478bd9Sstevel@tonic-gate } crypto_decrypt_init32_t;
5487c478bd9Sstevel@tonic-gate 
5497c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5507c478bd9Sstevel@tonic-gate #pragma pack()
5517c478bd9Sstevel@tonic-gate #endif
5527c478bd9Sstevel@tonic-gate 
5537c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_update32 {
5547c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
5557c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
5567c478bd9Sstevel@tonic-gate 	size32_t		du_encrlen;
5577c478bd9Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
5587c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
5597c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
5607c478bd9Sstevel@tonic-gate } crypto_decrypt_update32_t;
5617c478bd9Sstevel@tonic-gate 
5627c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_final32 {
5637c478bd9Sstevel@tonic-gate 	uint32_t		df_return_value;
5647c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
5657c478bd9Sstevel@tonic-gate 	size32_t		df_datalen;
5667c478bd9Sstevel@tonic-gate 	caddr32_t		df_databuf;
5677c478bd9Sstevel@tonic-gate } crypto_decrypt_final32_t;
5687c478bd9Sstevel@tonic-gate 
5697c478bd9Sstevel@tonic-gate typedef struct crypto_digest32 {
5707c478bd9Sstevel@tonic-gate 	uint32_t		cd_return_value;
5717c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
5727c478bd9Sstevel@tonic-gate 	size32_t		cd_datalen;
5737c478bd9Sstevel@tonic-gate 	caddr32_t		cd_databuf;
5747c478bd9Sstevel@tonic-gate 	size32_t		cd_digestlen;
5757c478bd9Sstevel@tonic-gate 	caddr32_t		cd_digestbuf;
5767c478bd9Sstevel@tonic-gate } crypto_digest32_t;
5777c478bd9Sstevel@tonic-gate 
5787c478bd9Sstevel@tonic-gate typedef struct crypto_digest_init32 {
5797c478bd9Sstevel@tonic-gate 	uint32_t		di_return_value;
5807c478bd9Sstevel@tonic-gate 	crypto_session_id_t	di_session;
5817c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
5827c478bd9Sstevel@tonic-gate } crypto_digest_init32_t;
5837c478bd9Sstevel@tonic-gate 
5847c478bd9Sstevel@tonic-gate typedef struct crypto_digest_update32 {
5857c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
5867c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
5877c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
5887c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
5897c478bd9Sstevel@tonic-gate } crypto_digest_update32_t;
5907c478bd9Sstevel@tonic-gate 
5917c478bd9Sstevel@tonic-gate typedef struct crypto_digest_key32 {
5927c478bd9Sstevel@tonic-gate 	uint32_t		dk_return_value;
5937c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
5947c478bd9Sstevel@tonic-gate 	crypto_key32_t		dk_key;
5957c478bd9Sstevel@tonic-gate } crypto_digest_key32_t;
5967c478bd9Sstevel@tonic-gate 
5977c478bd9Sstevel@tonic-gate typedef struct crypto_digest_final32 {
5987c478bd9Sstevel@tonic-gate 	uint32_t		df_return_value;
5997c478bd9Sstevel@tonic-gate 	crypto_session_id_t	df_session;
6007c478bd9Sstevel@tonic-gate 	size32_t		df_digestlen;
6017c478bd9Sstevel@tonic-gate 	caddr32_t		df_digestbuf;
6027c478bd9Sstevel@tonic-gate } crypto_digest_final32_t;
6037c478bd9Sstevel@tonic-gate 
6047c478bd9Sstevel@tonic-gate typedef struct crypto_mac32 {
6057c478bd9Sstevel@tonic-gate 	uint32_t		cm_return_value;
6067c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
6077c478bd9Sstevel@tonic-gate 	size32_t		cm_datalen;
6087c478bd9Sstevel@tonic-gate 	caddr32_t		cm_databuf;
6097c478bd9Sstevel@tonic-gate 	size32_t		cm_maclen;
6107c478bd9Sstevel@tonic-gate 	caddr32_t		cm_macbuf;
6117c478bd9Sstevel@tonic-gate } crypto_mac32_t;
6127c478bd9Sstevel@tonic-gate 
6137c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6147c478bd9Sstevel@tonic-gate #pragma pack(4)
6157c478bd9Sstevel@tonic-gate #endif
6167c478bd9Sstevel@tonic-gate 
6177c478bd9Sstevel@tonic-gate typedef struct crypto_mac_init32 {
6187c478bd9Sstevel@tonic-gate 	uint32_t		mi_return_value;
6197c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
6207c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	mi_mech;
6217c478bd9Sstevel@tonic-gate 	crypto_key32_t		mi_key;
6227c478bd9Sstevel@tonic-gate } crypto_mac_init32_t;
6237c478bd9Sstevel@tonic-gate 
6247c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6257c478bd9Sstevel@tonic-gate #pragma pack()
6267c478bd9Sstevel@tonic-gate #endif
6277c478bd9Sstevel@tonic-gate 
6287c478bd9Sstevel@tonic-gate typedef struct crypto_mac_update32 {
6297c478bd9Sstevel@tonic-gate 	uint32_t		mu_return_value;
6307c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
6317c478bd9Sstevel@tonic-gate 	size32_t		mu_datalen;
6327c478bd9Sstevel@tonic-gate 	caddr32_t		mu_databuf;
6337c478bd9Sstevel@tonic-gate } crypto_mac_update32_t;
6347c478bd9Sstevel@tonic-gate 
6357c478bd9Sstevel@tonic-gate typedef struct crypto_mac_final32 {
6367c478bd9Sstevel@tonic-gate 	uint32_t		mf_return_value;
6377c478bd9Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
6387c478bd9Sstevel@tonic-gate 	size32_t		mf_maclen;
6397c478bd9Sstevel@tonic-gate 	caddr32_t		mf_macbuf;
6407c478bd9Sstevel@tonic-gate } crypto_mac_final32_t;
6417c478bd9Sstevel@tonic-gate 
6427c478bd9Sstevel@tonic-gate typedef struct crypto_sign32 {
6437c478bd9Sstevel@tonic-gate 	uint32_t		cs_return_value;
6447c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
6457c478bd9Sstevel@tonic-gate 	size32_t		cs_datalen;
6467c478bd9Sstevel@tonic-gate 	caddr32_t		cs_databuf;
6477c478bd9Sstevel@tonic-gate 	size32_t		cs_signlen;
6487c478bd9Sstevel@tonic-gate 	caddr32_t		cs_signbuf;
6497c478bd9Sstevel@tonic-gate } crypto_sign32_t;
6507c478bd9Sstevel@tonic-gate 
6517c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6527c478bd9Sstevel@tonic-gate #pragma pack(4)
6537c478bd9Sstevel@tonic-gate #endif
6547c478bd9Sstevel@tonic-gate 
6557c478bd9Sstevel@tonic-gate typedef struct crypto_sign_init32 {
6567c478bd9Sstevel@tonic-gate 	uint32_t		si_return_value;
6577c478bd9Sstevel@tonic-gate 	crypto_session_id_t	si_session;
6587c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	si_mech;
6597c478bd9Sstevel@tonic-gate 	crypto_key32_t		si_key;
6607c478bd9Sstevel@tonic-gate } crypto_sign_init32_t;
6617c478bd9Sstevel@tonic-gate 
6627c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6637c478bd9Sstevel@tonic-gate #pragma pack()
6647c478bd9Sstevel@tonic-gate #endif
6657c478bd9Sstevel@tonic-gate 
6667c478bd9Sstevel@tonic-gate typedef struct crypto_sign_update32 {
6677c478bd9Sstevel@tonic-gate 	uint32_t		su_return_value;
6687c478bd9Sstevel@tonic-gate 	crypto_session_id_t	su_session;
6697c478bd9Sstevel@tonic-gate 	size32_t		su_datalen;
6707c478bd9Sstevel@tonic-gate 	caddr32_t		su_databuf;
6717c478bd9Sstevel@tonic-gate } crypto_sign_update32_t;
6727c478bd9Sstevel@tonic-gate 
6737c478bd9Sstevel@tonic-gate typedef struct crypto_sign_final32 {
6747c478bd9Sstevel@tonic-gate 	uint32_t		sf_return_value;
6757c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
6767c478bd9Sstevel@tonic-gate 	size32_t		sf_signlen;
6777c478bd9Sstevel@tonic-gate 	caddr32_t		sf_signbuf;
6787c478bd9Sstevel@tonic-gate } crypto_sign_final32_t;
6797c478bd9Sstevel@tonic-gate 
6807c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6817c478bd9Sstevel@tonic-gate #pragma pack(4)
6827c478bd9Sstevel@tonic-gate #endif
6837c478bd9Sstevel@tonic-gate 
6847c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover_init32 {
6857c478bd9Sstevel@tonic-gate 	uint32_t		ri_return_value;
6867c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
6877c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
6887c478bd9Sstevel@tonic-gate 	crypto_key32_t		ri_key;
6897c478bd9Sstevel@tonic-gate } crypto_sign_recover_init32_t;
6907c478bd9Sstevel@tonic-gate 
6917c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6927c478bd9Sstevel@tonic-gate #pragma pack()
6937c478bd9Sstevel@tonic-gate #endif
6947c478bd9Sstevel@tonic-gate 
6957c478bd9Sstevel@tonic-gate typedef struct crypto_sign_recover32 {
6967c478bd9Sstevel@tonic-gate 	uint32_t		sr_return_value;
6977c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
6987c478bd9Sstevel@tonic-gate 	size32_t		sr_datalen;
6997c478bd9Sstevel@tonic-gate 	caddr32_t		sr_databuf;
7007c478bd9Sstevel@tonic-gate 	size32_t		sr_signlen;
7017c478bd9Sstevel@tonic-gate 	caddr32_t		sr_signbuf;
7027c478bd9Sstevel@tonic-gate } crypto_sign_recover32_t;
7037c478bd9Sstevel@tonic-gate 
7047c478bd9Sstevel@tonic-gate typedef struct crypto_verify32 {
7057c478bd9Sstevel@tonic-gate 	uint32_t		cv_return_value;
7067c478bd9Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
7077c478bd9Sstevel@tonic-gate 	size32_t		cv_datalen;
7087c478bd9Sstevel@tonic-gate 	caddr32_t		cv_databuf;
7097c478bd9Sstevel@tonic-gate 	size32_t		cv_signlen;
7107c478bd9Sstevel@tonic-gate 	caddr32_t		cv_signbuf;
7117c478bd9Sstevel@tonic-gate } crypto_verify32_t;
7127c478bd9Sstevel@tonic-gate 
7137c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7147c478bd9Sstevel@tonic-gate #pragma pack(4)
7157c478bd9Sstevel@tonic-gate #endif
7167c478bd9Sstevel@tonic-gate 
7177c478bd9Sstevel@tonic-gate typedef struct crypto_verify_init32 {
7187c478bd9Sstevel@tonic-gate 	uint32_t		vi_return_value;
7197c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
7207c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	vi_mech;
7217c478bd9Sstevel@tonic-gate 	crypto_key32_t		vi_key;
7227c478bd9Sstevel@tonic-gate } crypto_verify_init32_t;
7237c478bd9Sstevel@tonic-gate 
7247c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7257c478bd9Sstevel@tonic-gate #pragma pack()
7267c478bd9Sstevel@tonic-gate #endif
7277c478bd9Sstevel@tonic-gate 
7287c478bd9Sstevel@tonic-gate typedef struct crypto_verify_update32 {
7297c478bd9Sstevel@tonic-gate 	uint32_t		vu_return_value;
7307c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
7317c478bd9Sstevel@tonic-gate 	size32_t		vu_datalen;
7327c478bd9Sstevel@tonic-gate 	caddr32_t		vu_databuf;
7337c478bd9Sstevel@tonic-gate } crypto_verify_update32_t;
7347c478bd9Sstevel@tonic-gate 
7357c478bd9Sstevel@tonic-gate typedef struct crypto_verify_final32 {
7367c478bd9Sstevel@tonic-gate 	uint32_t		vf_return_value;
7377c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
7387c478bd9Sstevel@tonic-gate 	size32_t		vf_signlen;
7397c478bd9Sstevel@tonic-gate 	caddr32_t		vf_signbuf;
7407c478bd9Sstevel@tonic-gate } crypto_verify_final32_t;
7417c478bd9Sstevel@tonic-gate 
7427c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7437c478bd9Sstevel@tonic-gate #pragma pack(4)
7447c478bd9Sstevel@tonic-gate #endif
7457c478bd9Sstevel@tonic-gate 
7467c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover_init32 {
7477c478bd9Sstevel@tonic-gate 	uint32_t		ri_return_value;
7487c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
7497c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
7507c478bd9Sstevel@tonic-gate 	crypto_key32_t		ri_key;
7517c478bd9Sstevel@tonic-gate } crypto_verify_recover_init32_t;
7527c478bd9Sstevel@tonic-gate 
7537c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7547c478bd9Sstevel@tonic-gate #pragma pack()
7557c478bd9Sstevel@tonic-gate #endif
7567c478bd9Sstevel@tonic-gate 
7577c478bd9Sstevel@tonic-gate typedef struct crypto_verify_recover32 {
7587c478bd9Sstevel@tonic-gate 	uint32_t		vr_return_value;
7597c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
7607c478bd9Sstevel@tonic-gate 	size32_t		vr_signlen;
7617c478bd9Sstevel@tonic-gate 	caddr32_t		vr_signbuf;
7627c478bd9Sstevel@tonic-gate 	size32_t		vr_datalen;
7637c478bd9Sstevel@tonic-gate 	caddr32_t		vr_databuf;
7647c478bd9Sstevel@tonic-gate } crypto_verify_recover32_t;
7657c478bd9Sstevel@tonic-gate 
7667c478bd9Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update32 {
7677c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
7687c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
7697c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
7707c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
7717c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
7727c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
7737c478bd9Sstevel@tonic-gate } crypto_digest_encrypt_update32_t;
7747c478bd9Sstevel@tonic-gate 
7757c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update32 {
7767c478bd9Sstevel@tonic-gate 	uint32_t		du_return_value;
7777c478bd9Sstevel@tonic-gate 	crypto_session_id_t	du_session;
7787c478bd9Sstevel@tonic-gate 	size32_t		du_encrlen;
7797c478bd9Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
7807c478bd9Sstevel@tonic-gate 	size32_t		du_datalen;
7817c478bd9Sstevel@tonic-gate 	caddr32_t		du_databuf;
7827c478bd9Sstevel@tonic-gate } crypto_decrypt_digest_update32_t;
7837c478bd9Sstevel@tonic-gate 
7847c478bd9Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update32 {
7857c478bd9Sstevel@tonic-gate 	uint32_t		eu_return_value;
7867c478bd9Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
7877c478bd9Sstevel@tonic-gate 	size32_t		eu_datalen;
7887c478bd9Sstevel@tonic-gate 	caddr32_t		eu_databuf;
7897c478bd9Sstevel@tonic-gate 	size32_t		eu_encrlen;
7907c478bd9Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
7917c478bd9Sstevel@tonic-gate } crypto_sign_encrypt_update32_t;
7927c478bd9Sstevel@tonic-gate 
7937c478bd9Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update32 {
7947c478bd9Sstevel@tonic-gate 	uint32_t		vu_return_value;
7957c478bd9Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
7967c478bd9Sstevel@tonic-gate 	size32_t		vu_encrlen;
7977c478bd9Sstevel@tonic-gate 	caddr32_t		vu_encrbuf;
7987c478bd9Sstevel@tonic-gate 	size32_t		vu_datalen;
7997c478bd9Sstevel@tonic-gate 	caddr32_t		vu_databuf;
8007c478bd9Sstevel@tonic-gate } crypto_decrypt_verify_update32_t;
8017c478bd9Sstevel@tonic-gate 
8027c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
8037c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
8047c478bd9Sstevel@tonic-gate 
8057c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT			CRYPTO(50)
8067c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_INIT		CRYPTO(51)
8077c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_UPDATE		CRYPTO(52)
8087c478bd9Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_FINAL		CRYPTO(53)
8097c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT			CRYPTO(54)
8107c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_INIT		CRYPTO(55)
8117c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_UPDATE		CRYPTO(56)
8127c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_FINAL		CRYPTO(57)
8137c478bd9Sstevel@tonic-gate 
8147c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST			CRYPTO(58)
8157c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_INIT		CRYPTO(59)
8167c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_UPDATE		CRYPTO(60)
8177c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_KEY		CRYPTO(61)
8187c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_FINAL		CRYPTO(62)
8197c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC			CRYPTO(63)
8207c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_INIT			CRYPTO(64)
8217c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_UPDATE		CRYPTO(65)
8227c478bd9Sstevel@tonic-gate #define	CRYPTO_MAC_FINAL		CRYPTO(66)
8237c478bd9Sstevel@tonic-gate 
8247c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN			CRYPTO(67)
8257c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_INIT		CRYPTO(68)
8267c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_UPDATE		CRYPTO(69)
8277c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_FINAL		CRYPTO(70)
8287c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER_INIT	CRYPTO(71)
8297c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER		CRYPTO(72)
8307c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY			CRYPTO(73)
8317c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_INIT		CRYPTO(74)
8327c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_UPDATE		CRYPTO(75)
8337c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_FINAL		CRYPTO(76)
8347c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER_INIT	CRYPTO(77)
8357c478bd9Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER		CRYPTO(78)
8367c478bd9Sstevel@tonic-gate 
8377c478bd9Sstevel@tonic-gate #define	CRYPTO_DIGEST_ENCRYPT_UPDATE	CRYPTO(79)
8387c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_DIGEST_UPDATE	CRYPTO(80)
8397c478bd9Sstevel@tonic-gate #define	CRYPTO_SIGN_ENCRYPT_UPDATE	CRYPTO(81)
8407c478bd9Sstevel@tonic-gate #define	CRYPTO_DECRYPT_VERIFY_UPDATE	CRYPTO(82)
8417c478bd9Sstevel@tonic-gate 
8427c478bd9Sstevel@tonic-gate /*
8437c478bd9Sstevel@tonic-gate  * Random Number Ioctls
8447c478bd9Sstevel@tonic-gate  */
8457c478bd9Sstevel@tonic-gate typedef struct crypto_seed_random {
8467c478bd9Sstevel@tonic-gate 	uint_t			sr_return_value;
8477c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8487c478bd9Sstevel@tonic-gate 	size_t			sr_seedlen;
8497c478bd9Sstevel@tonic-gate 	caddr_t			sr_seedbuf;
8507c478bd9Sstevel@tonic-gate } crypto_seed_random_t;
8517c478bd9Sstevel@tonic-gate 
8527c478bd9Sstevel@tonic-gate typedef struct crypto_generate_random {
8537c478bd9Sstevel@tonic-gate 	uint_t			gr_return_value;
8547c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
8557c478bd9Sstevel@tonic-gate 	caddr_t			gr_buf;
8567c478bd9Sstevel@tonic-gate 	size_t			gr_buflen;
8577c478bd9Sstevel@tonic-gate } crypto_generate_random_t;
8587c478bd9Sstevel@tonic-gate 
8597c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
8607c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
8617c478bd9Sstevel@tonic-gate 
8627c478bd9Sstevel@tonic-gate typedef struct crypto_seed_random32 {
8637c478bd9Sstevel@tonic-gate 	uint32_t		sr_return_value;
8647c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8657c478bd9Sstevel@tonic-gate 	size32_t		sr_seedlen;
8667c478bd9Sstevel@tonic-gate 	caddr32_t		sr_seedbuf;
8677c478bd9Sstevel@tonic-gate } crypto_seed_random32_t;
8687c478bd9Sstevel@tonic-gate 
8697c478bd9Sstevel@tonic-gate typedef struct crypto_generate_random32 {
8707c478bd9Sstevel@tonic-gate 	uint32_t		gr_return_value;
8717c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
8727c478bd9Sstevel@tonic-gate 	caddr32_t		gr_buf;
8737c478bd9Sstevel@tonic-gate 	size32_t		gr_buflen;
8747c478bd9Sstevel@tonic-gate } crypto_generate_random32_t;
8757c478bd9Sstevel@tonic-gate 
8767c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
8777c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
8787c478bd9Sstevel@tonic-gate 
8797c478bd9Sstevel@tonic-gate #define	CRYPTO_SEED_RANDOM		CRYPTO(90)
8807c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_RANDOM		CRYPTO(91)
8817c478bd9Sstevel@tonic-gate 
8827c478bd9Sstevel@tonic-gate /*
8837c478bd9Sstevel@tonic-gate  * Object Management Ioctls
8847c478bd9Sstevel@tonic-gate  */
8857c478bd9Sstevel@tonic-gate typedef struct crypto_object_create {
8867c478bd9Sstevel@tonic-gate 	uint_t			oc_return_value;
8877c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
8887c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
8897c478bd9Sstevel@tonic-gate 	uint_t			oc_count;
8907c478bd9Sstevel@tonic-gate 	caddr_t			oc_attributes;
8917c478bd9Sstevel@tonic-gate } crypto_object_create_t;
8927c478bd9Sstevel@tonic-gate 
8937c478bd9Sstevel@tonic-gate typedef struct crypto_object_copy {
8947c478bd9Sstevel@tonic-gate 	uint_t			oc_return_value;
8957c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
8967c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
8977c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
8987c478bd9Sstevel@tonic-gate 	uint_t			oc_count;
8997c478bd9Sstevel@tonic-gate 	caddr_t			oc_new_attributes;
9007c478bd9Sstevel@tonic-gate } crypto_object_copy_t;
9017c478bd9Sstevel@tonic-gate 
9027c478bd9Sstevel@tonic-gate typedef struct crypto_object_destroy {
9037c478bd9Sstevel@tonic-gate 	uint_t			od_return_value;
9047c478bd9Sstevel@tonic-gate 	crypto_session_id_t	od_session;
9057c478bd9Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
9067c478bd9Sstevel@tonic-gate } crypto_object_destroy_t;
9077c478bd9Sstevel@tonic-gate 
9087c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value {
9097c478bd9Sstevel@tonic-gate 	uint_t			og_return_value;
9107c478bd9Sstevel@tonic-gate 	crypto_session_id_t	og_session;
9117c478bd9Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
9127c478bd9Sstevel@tonic-gate 	uint_t			og_count;
9137c478bd9Sstevel@tonic-gate 	caddr_t			og_attributes;
9147c478bd9Sstevel@tonic-gate } crypto_object_get_attribute_value_t;
9157c478bd9Sstevel@tonic-gate 
9167c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_size {
9177c478bd9Sstevel@tonic-gate 	uint_t			gs_return_value;
9187c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
9197c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
9207c478bd9Sstevel@tonic-gate 	size_t			gs_size;
9217c478bd9Sstevel@tonic-gate } crypto_object_get_size_t;
9227c478bd9Sstevel@tonic-gate 
9237c478bd9Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value {
9247c478bd9Sstevel@tonic-gate 	uint_t			sa_return_value;
9257c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
9267c478bd9Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
9277c478bd9Sstevel@tonic-gate 	uint_t			sa_count;
9287c478bd9Sstevel@tonic-gate 	caddr_t			sa_attributes;
9297c478bd9Sstevel@tonic-gate } crypto_object_set_attribute_value_t;
9307c478bd9Sstevel@tonic-gate 
9317c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_init {
9327c478bd9Sstevel@tonic-gate 	uint_t			fi_return_value;
9337c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
9347c478bd9Sstevel@tonic-gate 	uint_t			fi_count;
9357c478bd9Sstevel@tonic-gate 	caddr_t			fi_attributes;
9367c478bd9Sstevel@tonic-gate } crypto_object_find_init_t;
9377c478bd9Sstevel@tonic-gate 
9387c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_update {
9397c478bd9Sstevel@tonic-gate 	uint_t			fu_return_value;
9407c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
9417c478bd9Sstevel@tonic-gate 	uint_t			fu_max_count;
9427c478bd9Sstevel@tonic-gate 	uint_t			fu_count;
9437c478bd9Sstevel@tonic-gate 	caddr_t			fu_handles;
9447c478bd9Sstevel@tonic-gate } crypto_object_find_update_t;
9457c478bd9Sstevel@tonic-gate 
9467c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_final {
9477c478bd9Sstevel@tonic-gate 	uint_t			ff_return_value;
9487c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
9497c478bd9Sstevel@tonic-gate } crypto_object_find_final_t;
9507c478bd9Sstevel@tonic-gate 
9517c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
9527c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
9537c478bd9Sstevel@tonic-gate 
9547c478bd9Sstevel@tonic-gate typedef struct crypto_object_create32 {
9557c478bd9Sstevel@tonic-gate 	uint32_t		oc_return_value;
9567c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9577c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9587c478bd9Sstevel@tonic-gate 	uint32_t		oc_count;
9597c478bd9Sstevel@tonic-gate 	caddr32_t		oc_attributes;
9607c478bd9Sstevel@tonic-gate } crypto_object_create32_t;
9617c478bd9Sstevel@tonic-gate 
9627c478bd9Sstevel@tonic-gate typedef struct crypto_object_copy32 {
9637c478bd9Sstevel@tonic-gate 	uint32_t		oc_return_value;
9647c478bd9Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9657c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9667c478bd9Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
9677c478bd9Sstevel@tonic-gate 	uint32_t		oc_count;
9687c478bd9Sstevel@tonic-gate 	caddr32_t		oc_new_attributes;
9697c478bd9Sstevel@tonic-gate } crypto_object_copy32_t;
9707c478bd9Sstevel@tonic-gate 
9717c478bd9Sstevel@tonic-gate typedef struct crypto_object_destroy32 {
9727c478bd9Sstevel@tonic-gate 	uint32_t		od_return_value;
9737c478bd9Sstevel@tonic-gate 	crypto_session_id_t	od_session;
9747c478bd9Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
9757c478bd9Sstevel@tonic-gate } crypto_object_destroy32_t;
9767c478bd9Sstevel@tonic-gate 
9777c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value32 {
9787c478bd9Sstevel@tonic-gate 	uint32_t		og_return_value;
9797c478bd9Sstevel@tonic-gate 	crypto_session_id_t	og_session;
9807c478bd9Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
9817c478bd9Sstevel@tonic-gate 	uint32_t		og_count;
9827c478bd9Sstevel@tonic-gate 	caddr32_t		og_attributes;
9837c478bd9Sstevel@tonic-gate } crypto_object_get_attribute_value32_t;
9847c478bd9Sstevel@tonic-gate 
9857c478bd9Sstevel@tonic-gate typedef struct crypto_object_get_size32 {
9867c478bd9Sstevel@tonic-gate 	uint32_t		gs_return_value;
9877c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
9887c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
9897c478bd9Sstevel@tonic-gate 	size32_t		gs_size;
9907c478bd9Sstevel@tonic-gate } crypto_object_get_size32_t;
9917c478bd9Sstevel@tonic-gate 
9927c478bd9Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value32 {
9937c478bd9Sstevel@tonic-gate 	uint32_t		sa_return_value;
9947c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
9957c478bd9Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
9967c478bd9Sstevel@tonic-gate 	uint32_t		sa_count;
9977c478bd9Sstevel@tonic-gate 	caddr32_t		sa_attributes;
9987c478bd9Sstevel@tonic-gate } crypto_object_set_attribute_value32_t;
9997c478bd9Sstevel@tonic-gate 
10007c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_init32 {
10017c478bd9Sstevel@tonic-gate 	uint32_t		fi_return_value;
10027c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
10037c478bd9Sstevel@tonic-gate 	uint32_t		fi_count;
10047c478bd9Sstevel@tonic-gate 	caddr32_t		fi_attributes;
10057c478bd9Sstevel@tonic-gate } crypto_object_find_init32_t;
10067c478bd9Sstevel@tonic-gate 
10077c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_update32 {
10087c478bd9Sstevel@tonic-gate 	uint32_t		fu_return_value;
10097c478bd9Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
10107c478bd9Sstevel@tonic-gate 	uint32_t		fu_max_count;
10117c478bd9Sstevel@tonic-gate 	uint32_t		fu_count;
10127c478bd9Sstevel@tonic-gate 	caddr32_t		fu_handles;
10137c478bd9Sstevel@tonic-gate } crypto_object_find_update32_t;
10147c478bd9Sstevel@tonic-gate 
10157c478bd9Sstevel@tonic-gate typedef struct crypto_object_find_final32 {
10167c478bd9Sstevel@tonic-gate 	uint32_t		ff_return_value;
10177c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
10187c478bd9Sstevel@tonic-gate } crypto_object_find_final32_t;
10197c478bd9Sstevel@tonic-gate 
10207c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
10217c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
10227c478bd9Sstevel@tonic-gate 
10237c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_CREATE			CRYPTO(100)
10247c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_COPY			CRYPTO(101)
10257c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_DESTROY			CRYPTO(102)
10267c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE	CRYPTO(103)
10277c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_SIZE			CRYPTO(104)
10287c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE	CRYPTO(105)
10297c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_INIT			CRYPTO(106)
10307c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_UPDATE		CRYPTO(107)
10317c478bd9Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_FINAL		CRYPTO(108)
10327c478bd9Sstevel@tonic-gate 
10337c478bd9Sstevel@tonic-gate /*
10347c478bd9Sstevel@tonic-gate  * Key Generation Ioctls
10357c478bd9Sstevel@tonic-gate  */
10367c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key {
10377c478bd9Sstevel@tonic-gate 	uint_t			gk_return_value;
10387c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
10397c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
10407c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	gk_mechanism;
10417c478bd9Sstevel@tonic-gate 	uint_t			gk_count;
10427c478bd9Sstevel@tonic-gate 	caddr_t			gk_attributes;
10437c478bd9Sstevel@tonic-gate } crypto_object_generate_key_t;
10447c478bd9Sstevel@tonic-gate 
10457c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair {
10467c478bd9Sstevel@tonic-gate 	uint_t			kp_return_value;
10477c478bd9Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
10487c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
10497c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
10507c478bd9Sstevel@tonic-gate 	uint_t			kp_public_count;
10517c478bd9Sstevel@tonic-gate 	uint_t			kp_private_count;
10527c478bd9Sstevel@tonic-gate 	caddr_t			kp_public_attributes;
10537c478bd9Sstevel@tonic-gate 	caddr_t			kp_private_attributes;
10547c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	kp_mechanism;
10557c478bd9Sstevel@tonic-gate } crypto_object_generate_key_pair_t;
10567c478bd9Sstevel@tonic-gate 
10577c478bd9Sstevel@tonic-gate typedef struct crypto_object_wrap_key {
10587c478bd9Sstevel@tonic-gate 	uint_t			wk_return_value;
10597c478bd9Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
10607c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	wk_mechanism;
10617c478bd9Sstevel@tonic-gate 	crypto_key_t		wk_wrapping_key;
10627c478bd9Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
10637c478bd9Sstevel@tonic-gate 	size_t			wk_wrapped_key_len;
10647c478bd9Sstevel@tonic-gate 	caddr_t			wk_wrapped_key;
10657c478bd9Sstevel@tonic-gate } crypto_object_wrap_key_t;
10667c478bd9Sstevel@tonic-gate 
10677c478bd9Sstevel@tonic-gate typedef struct crypto_object_unwrap_key {
10687c478bd9Sstevel@tonic-gate 	uint_t			uk_return_value;
10697c478bd9Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
10707c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	uk_mechanism;
10717c478bd9Sstevel@tonic-gate 	crypto_key_t		uk_unwrapping_key;
10727c478bd9Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
10737c478bd9Sstevel@tonic-gate 	size_t			uk_wrapped_key_len;
10747c478bd9Sstevel@tonic-gate 	caddr_t			uk_wrapped_key;
10757c478bd9Sstevel@tonic-gate 	uint_t			uk_count;
10767c478bd9Sstevel@tonic-gate 	caddr_t			uk_attributes;
10777c478bd9Sstevel@tonic-gate } crypto_object_unwrap_key_t;
10787c478bd9Sstevel@tonic-gate 
10797c478bd9Sstevel@tonic-gate typedef struct crypto_derive_key {
10807c478bd9Sstevel@tonic-gate 	uint_t			dk_return_value;
10817c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
10827c478bd9Sstevel@tonic-gate 	crypto_mechanism_t	dk_mechanism;
10837c478bd9Sstevel@tonic-gate 	crypto_key_t		dk_base_key;
10847c478bd9Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
10857c478bd9Sstevel@tonic-gate 	uint_t			dk_count;
10867c478bd9Sstevel@tonic-gate 	caddr_t			dk_attributes;
10877c478bd9Sstevel@tonic-gate } crypto_derive_key_t;
10887c478bd9Sstevel@tonic-gate 
10897c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
10907c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
10917c478bd9Sstevel@tonic-gate 
10927c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
10937c478bd9Sstevel@tonic-gate #pragma pack(4)
10947c478bd9Sstevel@tonic-gate #endif
10957c478bd9Sstevel@tonic-gate 
10967c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key32 {
10977c478bd9Sstevel@tonic-gate 	uint32_t		gk_return_value;
10987c478bd9Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
10997c478bd9Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
11007c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	gk_mechanism;
11017c478bd9Sstevel@tonic-gate 	uint32_t		gk_count;
11027c478bd9Sstevel@tonic-gate 	caddr32_t		gk_attributes;
11037c478bd9Sstevel@tonic-gate } crypto_object_generate_key32_t;
11047c478bd9Sstevel@tonic-gate 
11057c478bd9Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
11067c478bd9Sstevel@tonic-gate #pragma pack()
11077c478bd9Sstevel@tonic-gate #endif
11087c478bd9Sstevel@tonic-gate 
11097c478bd9Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair32 {
11107c478bd9Sstevel@tonic-gate 	uint32_t		kp_return_value;
11117c478bd9Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
11127c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
11137c478bd9Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
11147c478bd9Sstevel@tonic-gate 	uint32_t		kp_public_count;
11157c478bd9Sstevel@tonic-gate 	uint32_t		kp_private_count;
11167c478bd9Sstevel@tonic-gate 	caddr32_t		kp_public_attributes;
11177c478bd9Sstevel@tonic-gate 	caddr32_t		kp_private_attributes;
11187c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	kp_mechanism;
11197c478bd9Sstevel@tonic-gate } crypto_object_generate_key_pair32_t;
11207c478bd9Sstevel@tonic-gate 
11217c478bd9Sstevel@tonic-gate typedef struct crypto_object_wrap_key32 {
11227c478bd9Sstevel@tonic-gate 	uint32_t		wk_return_value;
11237c478bd9Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
11247c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	wk_mechanism;
11257c478bd9Sstevel@tonic-gate 	crypto_key32_t		wk_wrapping_key;
11267c478bd9Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
11277c478bd9Sstevel@tonic-gate 	size32_t		wk_wrapped_key_len;
11287c478bd9Sstevel@tonic-gate 	caddr32_t		wk_wrapped_key;
11297c478bd9Sstevel@tonic-gate } crypto_object_wrap_key32_t;
11307c478bd9Sstevel@tonic-gate 
11317c478bd9Sstevel@tonic-gate typedef struct crypto_object_unwrap_key32 {
11327c478bd9Sstevel@tonic-gate 	uint32_t		uk_return_value;
11337c478bd9Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
11347c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	uk_mechanism;
11357c478bd9Sstevel@tonic-gate 	crypto_key32_t		uk_unwrapping_key;
11367c478bd9Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
11377c478bd9Sstevel@tonic-gate 	size32_t		uk_wrapped_key_len;
11387c478bd9Sstevel@tonic-gate 	caddr32_t		uk_wrapped_key;
11397c478bd9Sstevel@tonic-gate 	uint32_t		uk_count;
11407c478bd9Sstevel@tonic-gate 	caddr32_t		uk_attributes;
11417c478bd9Sstevel@tonic-gate } crypto_object_unwrap_key32_t;
11427c478bd9Sstevel@tonic-gate 
11437c478bd9Sstevel@tonic-gate typedef struct crypto_derive_key32 {
11447c478bd9Sstevel@tonic-gate 	uint32_t		dk_return_value;
11457c478bd9Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
11467c478bd9Sstevel@tonic-gate 	crypto_mechanism32_t	dk_mechanism;
11477c478bd9Sstevel@tonic-gate 	crypto_key32_t		dk_base_key;
11487c478bd9Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
11497c478bd9Sstevel@tonic-gate 	uint32_t		dk_count;
11507c478bd9Sstevel@tonic-gate 	caddr32_t		dk_attributes;
11517c478bd9Sstevel@tonic-gate } crypto_derive_key32_t;
11527c478bd9Sstevel@tonic-gate 
11537c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
11547c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
11557c478bd9Sstevel@tonic-gate 
11567c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY		CRYPTO(110)
11577c478bd9Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY_PAIR	CRYPTO(111)
11587c478bd9Sstevel@tonic-gate #define	CRYPTO_WRAP_KEY			CRYPTO(112)
11597c478bd9Sstevel@tonic-gate #define	CRYPTO_UNWRAP_KEY		CRYPTO(113)
11607c478bd9Sstevel@tonic-gate #define	CRYPTO_DERIVE_KEY		CRYPTO(114)
11617c478bd9Sstevel@tonic-gate 
11627c478bd9Sstevel@tonic-gate /*
11637c478bd9Sstevel@tonic-gate  * Provider Management Ioctls
11647c478bd9Sstevel@tonic-gate  */
11657c478bd9Sstevel@tonic-gate 
11667c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_list {
11677c478bd9Sstevel@tonic-gate 	uint_t			pl_return_value;
11687c478bd9Sstevel@tonic-gate 	uint_t			pl_count;
11697c478bd9Sstevel@tonic-gate 	crypto_provider_entry_t	pl_list[1];
11707c478bd9Sstevel@tonic-gate } crypto_get_provider_list_t;
11717c478bd9Sstevel@tonic-gate 
11727c478bd9Sstevel@tonic-gate typedef struct crypto_provider_data {
11737c478bd9Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
11747c478bd9Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
11757c478bd9Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
11767c478bd9Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
11777c478bd9Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
11787c478bd9Sstevel@tonic-gate 	ulong_t			pd_flags;
11797c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_session_count;
11807c478bd9Sstevel@tonic-gate 	ulong_t			pd_session_count;
11817c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_rw_session_count;
11827c478bd9Sstevel@tonic-gate 	ulong_t			pd_rw_session_count;
11837c478bd9Sstevel@tonic-gate 	ulong_t			pd_max_pin_len;
11847c478bd9Sstevel@tonic-gate 	ulong_t			pd_min_pin_len;
11857c478bd9Sstevel@tonic-gate 	ulong_t			pd_total_public_memory;
11867c478bd9Sstevel@tonic-gate 	ulong_t			pd_free_public_memory;
11877c478bd9Sstevel@tonic-gate 	ulong_t			pd_total_private_memory;
11887c478bd9Sstevel@tonic-gate 	ulong_t			pd_free_private_memory;
11897c478bd9Sstevel@tonic-gate 	crypto_version_t	pd_hardware_version;
11907c478bd9Sstevel@tonic-gate 	crypto_version_t	pd_firmware_version;
11917c478bd9Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
11927c478bd9Sstevel@tonic-gate } crypto_provider_data_t;
11937c478bd9Sstevel@tonic-gate 
11947c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_info {
11957c478bd9Sstevel@tonic-gate 	uint_t			gi_return_value;
11967c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
11977c478bd9Sstevel@tonic-gate 	crypto_provider_data_t	gi_provider_data;
11987c478bd9Sstevel@tonic-gate } crypto_get_provider_info_t;
11997c478bd9Sstevel@tonic-gate 
12007c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms {
12017c478bd9Sstevel@tonic-gate 	uint_t			pm_return_value;
12027c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
12037c478bd9Sstevel@tonic-gate 	uint_t			pm_count;
12047c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
12057c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanisms_t;
12067c478bd9Sstevel@tonic-gate 
12077c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanism_info {
12087c478bd9Sstevel@tonic-gate 	uint_t			mi_return_value;
12097c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	mi_provider_id;
12107c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	mi_mechanism_name;
12117c478bd9Sstevel@tonic-gate 	uint32_t		mi_min_key_size;
12127c478bd9Sstevel@tonic-gate 	uint32_t		mi_max_key_size;
12137c478bd9Sstevel@tonic-gate 	uint32_t		mi_flags;
12147c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanism_info_t;
12157c478bd9Sstevel@tonic-gate 
12167c478bd9Sstevel@tonic-gate typedef struct crypto_init_token {
12177c478bd9Sstevel@tonic-gate 	uint_t			it_return_value;
12187c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
12197c478bd9Sstevel@tonic-gate 	caddr_t			it_pin;
12207c478bd9Sstevel@tonic-gate 	size_t			it_pin_len;
12217c478bd9Sstevel@tonic-gate 	caddr_t			it_label;
12227c478bd9Sstevel@tonic-gate } crypto_init_token_t;
12237c478bd9Sstevel@tonic-gate 
12247c478bd9Sstevel@tonic-gate typedef struct crypto_init_pin {
12257c478bd9Sstevel@tonic-gate 	uint_t			ip_return_value;
12267c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
12277c478bd9Sstevel@tonic-gate 	caddr_t			ip_pin;
12287c478bd9Sstevel@tonic-gate 	size_t			ip_pin_len;
12297c478bd9Sstevel@tonic-gate } crypto_init_pin_t;
12307c478bd9Sstevel@tonic-gate 
12317c478bd9Sstevel@tonic-gate typedef struct crypto_set_pin {
12327c478bd9Sstevel@tonic-gate 	uint_t			sp_return_value;
12337c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
12347c478bd9Sstevel@tonic-gate 	caddr_t			sp_old_pin;
12357c478bd9Sstevel@tonic-gate 	size_t			sp_old_len;
12367c478bd9Sstevel@tonic-gate 	caddr_t			sp_new_pin;
12377c478bd9Sstevel@tonic-gate 	size_t			sp_new_len;
12387c478bd9Sstevel@tonic-gate } crypto_set_pin_t;
12397c478bd9Sstevel@tonic-gate 
12407c478bd9Sstevel@tonic-gate #ifdef	_KERNEL
12417c478bd9Sstevel@tonic-gate #ifdef	_SYSCALL32
12427c478bd9Sstevel@tonic-gate 
12437c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_list32 {
12447c478bd9Sstevel@tonic-gate 	uint32_t		pl_return_value;
12457c478bd9Sstevel@tonic-gate 	uint32_t		pl_count;
12467c478bd9Sstevel@tonic-gate 	crypto_provider_entry_t pl_list[1];
12477c478bd9Sstevel@tonic-gate } crypto_get_provider_list32_t;
12487c478bd9Sstevel@tonic-gate 
12497c478bd9Sstevel@tonic-gate typedef struct crypto_version32 {
12507c478bd9Sstevel@tonic-gate 	uchar_t	cv_major;
12517c478bd9Sstevel@tonic-gate 	uchar_t	cv_minor;
12527c478bd9Sstevel@tonic-gate } crypto_version32_t;
12537c478bd9Sstevel@tonic-gate 
12547c478bd9Sstevel@tonic-gate typedef struct crypto_provider_data32 {
12557c478bd9Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
12567c478bd9Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
12577c478bd9Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
12587c478bd9Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
12597c478bd9Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
12607c478bd9Sstevel@tonic-gate 	uint32_t		pd_flags;
12617c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_session_count;
12627c478bd9Sstevel@tonic-gate 	uint32_t		pd_session_count;
12637c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_rw_session_count;
12647c478bd9Sstevel@tonic-gate 	uint32_t		pd_rw_session_count;
12657c478bd9Sstevel@tonic-gate 	uint32_t		pd_max_pin_len;
12667c478bd9Sstevel@tonic-gate 	uint32_t		pd_min_pin_len;
12677c478bd9Sstevel@tonic-gate 	uint32_t		pd_total_public_memory;
12687c478bd9Sstevel@tonic-gate 	uint32_t		pd_free_public_memory;
12697c478bd9Sstevel@tonic-gate 	uint32_t		pd_total_private_memory;
12707c478bd9Sstevel@tonic-gate 	uint32_t		pd_free_private_memory;
12717c478bd9Sstevel@tonic-gate 	crypto_version32_t	pd_hardware_version;
12727c478bd9Sstevel@tonic-gate 	crypto_version32_t	pd_firmware_version;
12737c478bd9Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
12747c478bd9Sstevel@tonic-gate } crypto_provider_data32_t;
12757c478bd9Sstevel@tonic-gate 
12767c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_info32 {
12777c478bd9Sstevel@tonic-gate 	uint32_t		gi_return_value;
12787c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
12797c478bd9Sstevel@tonic-gate 	crypto_provider_data32_t gi_provider_data;
12807c478bd9Sstevel@tonic-gate } crypto_get_provider_info32_t;
12817c478bd9Sstevel@tonic-gate 
12827c478bd9Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms32 {
12837c478bd9Sstevel@tonic-gate 	uint32_t		pm_return_value;
12847c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
12857c478bd9Sstevel@tonic-gate 	uint32_t		pm_count;
12867c478bd9Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
12877c478bd9Sstevel@tonic-gate } crypto_get_provider_mechanisms32_t;
12887c478bd9Sstevel@tonic-gate 
12897c478bd9Sstevel@tonic-gate typedef struct crypto_init_token32 {
12907c478bd9Sstevel@tonic-gate 	uint32_t		it_return_value;
12917c478bd9Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
12927c478bd9Sstevel@tonic-gate 	caddr32_t		it_pin;
12937c478bd9Sstevel@tonic-gate 	size32_t		it_pin_len;
12947c478bd9Sstevel@tonic-gate 	caddr32_t		it_label;
12957c478bd9Sstevel@tonic-gate } crypto_init_token32_t;
12967c478bd9Sstevel@tonic-gate 
12977c478bd9Sstevel@tonic-gate typedef struct crypto_init_pin32 {
12987c478bd9Sstevel@tonic-gate 	uint32_t		ip_return_value;
12997c478bd9Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
13007c478bd9Sstevel@tonic-gate 	caddr32_t		ip_pin;
13017c478bd9Sstevel@tonic-gate 	size32_t		ip_pin_len;
13027c478bd9Sstevel@tonic-gate } crypto_init_pin32_t;
13037c478bd9Sstevel@tonic-gate 
13047c478bd9Sstevel@tonic-gate typedef struct crypto_set_pin32 {
13057c478bd9Sstevel@tonic-gate 	uint32_t		sp_return_value;
13067c478bd9Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
13077c478bd9Sstevel@tonic-gate 	caddr32_t		sp_old_pin;
13087c478bd9Sstevel@tonic-gate 	size32_t		sp_old_len;
13097c478bd9Sstevel@tonic-gate 	caddr32_t		sp_new_pin;
13107c478bd9Sstevel@tonic-gate 	size32_t		sp_new_len;
13117c478bd9Sstevel@tonic-gate } crypto_set_pin32_t;
13127c478bd9Sstevel@tonic-gate 
13137c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
13147c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
13157c478bd9Sstevel@tonic-gate 
13167c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_LIST		CRYPTO(120)
13177c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_INFO		CRYPTO(121)
13187c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISMS		CRYPTO(122)
13197c478bd9Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISM_INFO	CRYPTO(123)
13207c478bd9Sstevel@tonic-gate #define	CRYPTO_INIT_TOKEN			CRYPTO(124)
13217c478bd9Sstevel@tonic-gate #define	CRYPTO_INIT_PIN				CRYPTO(125)
13227c478bd9Sstevel@tonic-gate #define	CRYPTO_SET_PIN				CRYPTO(126)
13237c478bd9Sstevel@tonic-gate 
13247c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
13257c478bd9Sstevel@tonic-gate }
13267c478bd9Sstevel@tonic-gate #endif
13277c478bd9Sstevel@tonic-gate 
13287c478bd9Sstevel@tonic-gate #endif	/* _SYS_CRYPTO_IOCTL_H */
1329