xref: /onnv-gate/usr/src/uts/common/sys/crypto/ioctl.h (revision 11304:3092d1e303d6)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
53096Skrishna  * Common Development and Distribution License (the "License").
63096Skrishna  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
214072Skrishna 
220Sstevel@tonic-gate /*
2311030Sopensolaris@drydog.com  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_CRYPTO_IOCTL_H
280Sstevel@tonic-gate #define	_SYS_CRYPTO_IOCTL_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #ifdef	__cplusplus
310Sstevel@tonic-gate extern "C" {
320Sstevel@tonic-gate #endif
330Sstevel@tonic-gate 
340Sstevel@tonic-gate #include <sys/types.h>
358313SDina.Nimeh@Sun.Com #include <sys/crypto/api.h>
360Sstevel@tonic-gate #include <sys/crypto/spi.h>
370Sstevel@tonic-gate #include <sys/crypto/common.h>
380Sstevel@tonic-gate 
390Sstevel@tonic-gate #define	CRYPTO_MAX_ATTRIBUTE_COUNT	128
400Sstevel@tonic-gate 
410Sstevel@tonic-gate #define	CRYPTO_IOFLAGS_RW_SESSION	0x00000001
420Sstevel@tonic-gate 
430Sstevel@tonic-gate #define	CRYPTO(x)		(('y' << 8) | (x))
440Sstevel@tonic-gate 
454841Shaimay #define	MAX_NUM_THRESHOLD	7
464841Shaimay 
474841Shaimay /* the PKCS11 Mechanisms */
484841Shaimay #define	CKM_RC4			0x00000111
494841Shaimay #define	CKM_DES3_ECB		0x00000132
504841Shaimay #define	CKM_DES3_CBC		0x00000133
514841Shaimay #define	CKM_MD5			0x00000210
524841Shaimay #define	CKM_SHA_1		0x00000220
534841Shaimay #define	CKM_AES_ECB		0x00001081
544841Shaimay #define	CKM_AES_CBC		0x00001082
554841Shaimay 
560Sstevel@tonic-gate /*
570Sstevel@tonic-gate  * General Purpose Ioctls
580Sstevel@tonic-gate  */
590Sstevel@tonic-gate 
604841Shaimay typedef struct fl_mechs_threshold {
614841Shaimay 	int		mech_type;
624841Shaimay 	uint32_t	mech_threshold;
634841Shaimay } fl_mechs_threshold_t;
644841Shaimay 
650Sstevel@tonic-gate typedef struct crypto_function_list {
660Sstevel@tonic-gate 	boolean_t fl_digest_init;
670Sstevel@tonic-gate 	boolean_t fl_digest;
680Sstevel@tonic-gate 	boolean_t fl_digest_update;
690Sstevel@tonic-gate 	boolean_t fl_digest_key;
700Sstevel@tonic-gate 	boolean_t fl_digest_final;
710Sstevel@tonic-gate 
720Sstevel@tonic-gate 	boolean_t fl_encrypt_init;
730Sstevel@tonic-gate 	boolean_t fl_encrypt;
740Sstevel@tonic-gate 	boolean_t fl_encrypt_update;
750Sstevel@tonic-gate 	boolean_t fl_encrypt_final;
760Sstevel@tonic-gate 
770Sstevel@tonic-gate 	boolean_t fl_decrypt_init;
780Sstevel@tonic-gate 	boolean_t fl_decrypt;
790Sstevel@tonic-gate 	boolean_t fl_decrypt_update;
800Sstevel@tonic-gate 	boolean_t fl_decrypt_final;
810Sstevel@tonic-gate 
820Sstevel@tonic-gate 	boolean_t fl_mac_init;
830Sstevel@tonic-gate 	boolean_t fl_mac;
840Sstevel@tonic-gate 	boolean_t fl_mac_update;
850Sstevel@tonic-gate 	boolean_t fl_mac_final;
860Sstevel@tonic-gate 
870Sstevel@tonic-gate 	boolean_t fl_sign_init;
880Sstevel@tonic-gate 	boolean_t fl_sign;
890Sstevel@tonic-gate 	boolean_t fl_sign_update;
900Sstevel@tonic-gate 	boolean_t fl_sign_final;
910Sstevel@tonic-gate 	boolean_t fl_sign_recover_init;
920Sstevel@tonic-gate 	boolean_t fl_sign_recover;
930Sstevel@tonic-gate 
940Sstevel@tonic-gate 	boolean_t fl_verify_init;
950Sstevel@tonic-gate 	boolean_t fl_verify;
960Sstevel@tonic-gate 	boolean_t fl_verify_update;
970Sstevel@tonic-gate 	boolean_t fl_verify_final;
980Sstevel@tonic-gate 	boolean_t fl_verify_recover_init;
990Sstevel@tonic-gate 	boolean_t fl_verify_recover;
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate 	boolean_t fl_digest_encrypt_update;
1020Sstevel@tonic-gate 	boolean_t fl_decrypt_digest_update;
1030Sstevel@tonic-gate 	boolean_t fl_sign_encrypt_update;
1040Sstevel@tonic-gate 	boolean_t fl_decrypt_verify_update;
1050Sstevel@tonic-gate 
1060Sstevel@tonic-gate 	boolean_t fl_seed_random;
1070Sstevel@tonic-gate 	boolean_t fl_generate_random;
1080Sstevel@tonic-gate 
1090Sstevel@tonic-gate 	boolean_t fl_session_open;
1100Sstevel@tonic-gate 	boolean_t fl_session_close;
1110Sstevel@tonic-gate 	boolean_t fl_session_login;
1120Sstevel@tonic-gate 	boolean_t fl_session_logout;
1130Sstevel@tonic-gate 
1140Sstevel@tonic-gate 	boolean_t fl_object_create;
1150Sstevel@tonic-gate 	boolean_t fl_object_copy;
1160Sstevel@tonic-gate 	boolean_t fl_object_destroy;
1170Sstevel@tonic-gate 	boolean_t fl_object_get_size;
1180Sstevel@tonic-gate 	boolean_t fl_object_get_attribute_value;
1190Sstevel@tonic-gate 	boolean_t fl_object_set_attribute_value;
1200Sstevel@tonic-gate 	boolean_t fl_object_find_init;
1210Sstevel@tonic-gate 	boolean_t fl_object_find;
1220Sstevel@tonic-gate 	boolean_t fl_object_find_final;
1230Sstevel@tonic-gate 
1240Sstevel@tonic-gate 	boolean_t fl_key_generate;
1250Sstevel@tonic-gate 	boolean_t fl_key_generate_pair;
1260Sstevel@tonic-gate 	boolean_t fl_key_wrap;
1270Sstevel@tonic-gate 	boolean_t fl_key_unwrap;
1280Sstevel@tonic-gate 	boolean_t fl_key_derive;
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate 	boolean_t fl_init_token;
1310Sstevel@tonic-gate 	boolean_t fl_init_pin;
1320Sstevel@tonic-gate 	boolean_t fl_set_pin;
1334072Skrishna 
134*11304SJanie.Lu@Sun.COM 	boolean_t prov_is_hash_limited;
1354072Skrishna 	uint32_t prov_hash_threshold;
1364072Skrishna 	uint32_t prov_hash_limit;
1374841Shaimay 
138*11304SJanie.Lu@Sun.COM 	boolean_t prov_is_hmac_limited;
139*11304SJanie.Lu@Sun.COM 	uint32_t prov_hmac_limit;
140*11304SJanie.Lu@Sun.COM 
1414841Shaimay 	int total_threshold_count;
1424841Shaimay 	fl_mechs_threshold_t	fl_threshold[MAX_NUM_THRESHOLD];
1430Sstevel@tonic-gate } crypto_function_list_t;
1440Sstevel@tonic-gate 
1450Sstevel@tonic-gate typedef struct crypto_get_function_list {
1460Sstevel@tonic-gate 	uint_t			fl_return_value;
1470Sstevel@tonic-gate 	crypto_provider_id_t	fl_provider_id;
1480Sstevel@tonic-gate 	crypto_function_list_t	fl_list;
1490Sstevel@tonic-gate } crypto_get_function_list_t;
1500Sstevel@tonic-gate 
1510Sstevel@tonic-gate typedef struct crypto_get_mechanism_number {
1520Sstevel@tonic-gate 	uint_t			pn_return_value;
1530Sstevel@tonic-gate 	caddr_t			pn_mechanism_string;
1540Sstevel@tonic-gate 	size_t			pn_mechanism_len;
1550Sstevel@tonic-gate 	crypto_mech_type_t	pn_internal_number;
1560Sstevel@tonic-gate } crypto_get_mechanism_number_t;
1570Sstevel@tonic-gate 
1580Sstevel@tonic-gate #ifdef	_KERNEL
1590Sstevel@tonic-gate #ifdef	_SYSCALL32
1600Sstevel@tonic-gate 
1610Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1620Sstevel@tonic-gate #pragma pack(4)
1630Sstevel@tonic-gate #endif
1640Sstevel@tonic-gate 
1650Sstevel@tonic-gate typedef struct crypto_get_mechanism_number32 {
1660Sstevel@tonic-gate 	uint32_t		pn_return_value;
1670Sstevel@tonic-gate 	caddr32_t		pn_mechanism_string;
1680Sstevel@tonic-gate 	size32_t		pn_mechanism_len;
1690Sstevel@tonic-gate 	crypto_mech_type_t	pn_internal_number;
1700Sstevel@tonic-gate } crypto_get_mechanism_number32_t;
1710Sstevel@tonic-gate 
1720Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
1730Sstevel@tonic-gate #pragma pack()
1740Sstevel@tonic-gate #endif
1750Sstevel@tonic-gate 
1760Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1770Sstevel@tonic-gate #endif	/* _KERNEL */
1780Sstevel@tonic-gate 
1790Sstevel@tonic-gate #define	CRYPTO_GET_FUNCTION_LIST	CRYPTO(20)
1800Sstevel@tonic-gate #define	CRYPTO_GET_MECHANISM_NUMBER	CRYPTO(21)
1810Sstevel@tonic-gate 
1820Sstevel@tonic-gate /*
1830Sstevel@tonic-gate  * Session Ioctls
1840Sstevel@tonic-gate  */
1850Sstevel@tonic-gate 
1860Sstevel@tonic-gate typedef uint32_t	crypto_flags_t;
1870Sstevel@tonic-gate 
1880Sstevel@tonic-gate typedef struct crypto_open_session {
1890Sstevel@tonic-gate 	uint_t			os_return_value;
1900Sstevel@tonic-gate 	crypto_session_id_t	os_session;
1910Sstevel@tonic-gate 	crypto_flags_t		os_flags;
1920Sstevel@tonic-gate 	crypto_provider_id_t	os_provider_id;
1930Sstevel@tonic-gate } crypto_open_session_t;
1940Sstevel@tonic-gate 
1950Sstevel@tonic-gate typedef struct crypto_close_session {
1960Sstevel@tonic-gate 	uint_t			cs_return_value;
1970Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
1980Sstevel@tonic-gate } crypto_close_session_t;
1990Sstevel@tonic-gate 
2000Sstevel@tonic-gate typedef struct crypto_close_all_sessions {
2010Sstevel@tonic-gate 	uint_t			as_return_value;
2020Sstevel@tonic-gate 	crypto_provider_id_t	as_provider_id;
2030Sstevel@tonic-gate } crypto_close_all_sessions_t;
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate #define	CRYPTO_OPEN_SESSION		CRYPTO(30)
2060Sstevel@tonic-gate #define	CRYPTO_CLOSE_SESSION		CRYPTO(31)
2070Sstevel@tonic-gate #define	CRYPTO_CLOSE_ALL_SESSIONS	CRYPTO(32)
2080Sstevel@tonic-gate 
2090Sstevel@tonic-gate /*
2100Sstevel@tonic-gate  * Login Ioctls
2110Sstevel@tonic-gate  */
2120Sstevel@tonic-gate typedef struct crypto_login {
2130Sstevel@tonic-gate 	uint_t			co_return_value;
2140Sstevel@tonic-gate 	crypto_session_id_t	co_session;
2150Sstevel@tonic-gate 	uint_t			co_user_type;
2160Sstevel@tonic-gate 	uint_t			co_pin_len;
2170Sstevel@tonic-gate 	caddr_t			co_pin;
2180Sstevel@tonic-gate } crypto_login_t;
2190Sstevel@tonic-gate 
2200Sstevel@tonic-gate typedef struct crypto_logout {
2210Sstevel@tonic-gate 	uint_t			cl_return_value;
2220Sstevel@tonic-gate 	crypto_session_id_t	cl_session;
2230Sstevel@tonic-gate } crypto_logout_t;
2240Sstevel@tonic-gate 
2250Sstevel@tonic-gate #ifdef	_KERNEL
2260Sstevel@tonic-gate #ifdef	_SYSCALL32
2270Sstevel@tonic-gate 
2280Sstevel@tonic-gate typedef struct crypto_login32 {
2290Sstevel@tonic-gate 	uint32_t		co_return_value;
2300Sstevel@tonic-gate 	crypto_session_id_t	co_session;
2310Sstevel@tonic-gate 	uint32_t		co_user_type;
2320Sstevel@tonic-gate 	uint32_t		co_pin_len;
2330Sstevel@tonic-gate 	caddr32_t		co_pin;
2340Sstevel@tonic-gate } crypto_login32_t;
2350Sstevel@tonic-gate 
2360Sstevel@tonic-gate typedef struct crypto_logout32 {
2370Sstevel@tonic-gate 	uint32_t		cl_return_value;
2380Sstevel@tonic-gate 	crypto_session_id_t	cl_session;
2390Sstevel@tonic-gate } crypto_logout32_t;
2400Sstevel@tonic-gate 
2410Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2420Sstevel@tonic-gate #endif	/* _KERNEL */
2430Sstevel@tonic-gate 
2440Sstevel@tonic-gate #define	CRYPTO_LOGIN			CRYPTO(40)
2450Sstevel@tonic-gate #define	CRYPTO_LOGOUT			CRYPTO(41)
2460Sstevel@tonic-gate 
2474632Smcpowers /* flag for encrypt and decrypt operations */
2484632Smcpowers #define	CRYPTO_INPLACE_OPERATION	0x00000001
2494632Smcpowers 
2500Sstevel@tonic-gate /*
2510Sstevel@tonic-gate  * Cryptographic Ioctls
2520Sstevel@tonic-gate  */
2530Sstevel@tonic-gate typedef struct crypto_encrypt {
2540Sstevel@tonic-gate 	uint_t			ce_return_value;
2550Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
2560Sstevel@tonic-gate 	size_t			ce_datalen;
2570Sstevel@tonic-gate 	caddr_t			ce_databuf;
2580Sstevel@tonic-gate 	size_t			ce_encrlen;
2590Sstevel@tonic-gate 	caddr_t			ce_encrbuf;
2604632Smcpowers 	uint_t			ce_flags;
2610Sstevel@tonic-gate } crypto_encrypt_t;
2620Sstevel@tonic-gate 
2630Sstevel@tonic-gate typedef struct crypto_encrypt_init {
2640Sstevel@tonic-gate 	uint_t			ei_return_value;
2650Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
2660Sstevel@tonic-gate 	crypto_mechanism_t	ei_mech;
2670Sstevel@tonic-gate 	crypto_key_t		ei_key;
2680Sstevel@tonic-gate } crypto_encrypt_init_t;
2690Sstevel@tonic-gate 
2700Sstevel@tonic-gate typedef struct crypto_encrypt_update {
2710Sstevel@tonic-gate 	uint_t			eu_return_value;
2720Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
2730Sstevel@tonic-gate 	size_t			eu_datalen;
2740Sstevel@tonic-gate 	caddr_t			eu_databuf;
2750Sstevel@tonic-gate 	size_t			eu_encrlen;
2760Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
27711030Sopensolaris@drydog.com 	uint_t			eu_flags;
2780Sstevel@tonic-gate } crypto_encrypt_update_t;
2790Sstevel@tonic-gate 
2800Sstevel@tonic-gate typedef struct crypto_encrypt_final {
2810Sstevel@tonic-gate 	uint_t			ef_return_value;
2820Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
2830Sstevel@tonic-gate 	size_t			ef_encrlen;
2840Sstevel@tonic-gate 	caddr_t			ef_encrbuf;
2850Sstevel@tonic-gate } crypto_encrypt_final_t;
2860Sstevel@tonic-gate 
2870Sstevel@tonic-gate typedef struct crypto_decrypt {
2880Sstevel@tonic-gate 	uint_t			cd_return_value;
2890Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
2900Sstevel@tonic-gate 	size_t			cd_encrlen;
2910Sstevel@tonic-gate 	caddr_t			cd_encrbuf;
2920Sstevel@tonic-gate 	size_t			cd_datalen;
2930Sstevel@tonic-gate 	caddr_t			cd_databuf;
2944632Smcpowers 	uint_t			cd_flags;
2950Sstevel@tonic-gate } crypto_decrypt_t;
2960Sstevel@tonic-gate 
2970Sstevel@tonic-gate typedef struct crypto_decrypt_init {
2980Sstevel@tonic-gate 	uint_t			di_return_value;
2990Sstevel@tonic-gate 	crypto_session_id_t	di_session;
3000Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
3010Sstevel@tonic-gate 	crypto_key_t		di_key;
3020Sstevel@tonic-gate } crypto_decrypt_init_t;
3030Sstevel@tonic-gate 
3040Sstevel@tonic-gate typedef struct crypto_decrypt_update {
3050Sstevel@tonic-gate 	uint_t			du_return_value;
3060Sstevel@tonic-gate 	crypto_session_id_t	du_session;
3070Sstevel@tonic-gate 	size_t			du_encrlen;
3080Sstevel@tonic-gate 	caddr_t			du_encrbuf;
3090Sstevel@tonic-gate 	size_t			du_datalen;
3100Sstevel@tonic-gate 	caddr_t			du_databuf;
31111030Sopensolaris@drydog.com 	uint_t			du_flags;
3120Sstevel@tonic-gate } crypto_decrypt_update_t;
3130Sstevel@tonic-gate 
3140Sstevel@tonic-gate typedef struct crypto_decrypt_final {
3150Sstevel@tonic-gate 	uint_t			df_return_value;
3160Sstevel@tonic-gate 	crypto_session_id_t	df_session;
3170Sstevel@tonic-gate 	size_t			df_datalen;
3180Sstevel@tonic-gate 	caddr_t			df_databuf;
3190Sstevel@tonic-gate } crypto_decrypt_final_t;
3200Sstevel@tonic-gate 
3210Sstevel@tonic-gate typedef struct crypto_digest {
3220Sstevel@tonic-gate 	uint_t			cd_return_value;
3230Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
3240Sstevel@tonic-gate 	size_t			cd_datalen;
3250Sstevel@tonic-gate 	caddr_t			cd_databuf;
3260Sstevel@tonic-gate 	size_t			cd_digestlen;
3270Sstevel@tonic-gate 	caddr_t			cd_digestbuf;
3280Sstevel@tonic-gate } crypto_digest_t;
3290Sstevel@tonic-gate 
3300Sstevel@tonic-gate typedef struct crypto_digest_init {
3310Sstevel@tonic-gate 	uint_t			di_return_value;
3320Sstevel@tonic-gate 	crypto_session_id_t	di_session;
3330Sstevel@tonic-gate 	crypto_mechanism_t	di_mech;
3340Sstevel@tonic-gate } crypto_digest_init_t;
3350Sstevel@tonic-gate 
3360Sstevel@tonic-gate typedef struct crypto_digest_update {
3370Sstevel@tonic-gate 	uint_t			du_return_value;
3380Sstevel@tonic-gate 	crypto_session_id_t	du_session;
3390Sstevel@tonic-gate 	size_t			du_datalen;
3400Sstevel@tonic-gate 	caddr_t			du_databuf;
3410Sstevel@tonic-gate } crypto_digest_update_t;
3420Sstevel@tonic-gate 
3430Sstevel@tonic-gate typedef struct crypto_digest_key {
3440Sstevel@tonic-gate 	uint_t			dk_return_value;
3450Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
3460Sstevel@tonic-gate 	crypto_key_t		dk_key;
3470Sstevel@tonic-gate } crypto_digest_key_t;
3480Sstevel@tonic-gate 
3490Sstevel@tonic-gate typedef struct crypto_digest_final {
3500Sstevel@tonic-gate 	uint_t			df_return_value;
3510Sstevel@tonic-gate 	crypto_session_id_t	df_session;
3520Sstevel@tonic-gate 	size_t			df_digestlen;
3530Sstevel@tonic-gate 	caddr_t			df_digestbuf;
3540Sstevel@tonic-gate } crypto_digest_final_t;
3550Sstevel@tonic-gate 
3560Sstevel@tonic-gate typedef struct crypto_mac {
3570Sstevel@tonic-gate 	uint_t			cm_return_value;
3580Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
3590Sstevel@tonic-gate 	size_t			cm_datalen;
3600Sstevel@tonic-gate 	caddr_t			cm_databuf;
3610Sstevel@tonic-gate 	size_t			cm_maclen;
3620Sstevel@tonic-gate 	caddr_t			cm_macbuf;
3630Sstevel@tonic-gate } crypto_mac_t;
3640Sstevel@tonic-gate 
3650Sstevel@tonic-gate typedef struct crypto_mac_init {
3660Sstevel@tonic-gate 	uint_t			mi_return_value;
3670Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
3680Sstevel@tonic-gate 	crypto_mechanism_t	mi_mech;
3690Sstevel@tonic-gate 	crypto_key_t		mi_key;
3700Sstevel@tonic-gate } crypto_mac_init_t;
3710Sstevel@tonic-gate 
3720Sstevel@tonic-gate typedef struct crypto_mac_update {
3730Sstevel@tonic-gate 	uint_t			mu_return_value;
3740Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
3750Sstevel@tonic-gate 	size_t			mu_datalen;
3760Sstevel@tonic-gate 	caddr_t			mu_databuf;
3770Sstevel@tonic-gate } crypto_mac_update_t;
3780Sstevel@tonic-gate 
3790Sstevel@tonic-gate typedef struct crypto_mac_final {
3800Sstevel@tonic-gate 	uint_t			mf_return_value;
3810Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
3820Sstevel@tonic-gate 	size_t			mf_maclen;
3830Sstevel@tonic-gate 	caddr_t			mf_macbuf;
3840Sstevel@tonic-gate } crypto_mac_final_t;
3850Sstevel@tonic-gate 
3860Sstevel@tonic-gate typedef struct crypto_sign {
3870Sstevel@tonic-gate 	uint_t			cs_return_value;
3880Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
3890Sstevel@tonic-gate 	size_t			cs_datalen;
3900Sstevel@tonic-gate 	caddr_t			cs_databuf;
3910Sstevel@tonic-gate 	size_t			cs_signlen;
3920Sstevel@tonic-gate 	caddr_t			cs_signbuf;
3930Sstevel@tonic-gate } crypto_sign_t;
3940Sstevel@tonic-gate 
3950Sstevel@tonic-gate typedef struct crypto_sign_init {
3960Sstevel@tonic-gate 	uint_t			si_return_value;
3970Sstevel@tonic-gate 	crypto_session_id_t	si_session;
3980Sstevel@tonic-gate 	crypto_mechanism_t	si_mech;
3990Sstevel@tonic-gate 	crypto_key_t		si_key;
4000Sstevel@tonic-gate } crypto_sign_init_t;
4010Sstevel@tonic-gate 
4020Sstevel@tonic-gate typedef struct crypto_sign_update {
4030Sstevel@tonic-gate 	uint_t			su_return_value;
4040Sstevel@tonic-gate 	crypto_session_id_t	su_session;
4050Sstevel@tonic-gate 	size_t			su_datalen;
4060Sstevel@tonic-gate 	caddr_t			su_databuf;
4070Sstevel@tonic-gate } crypto_sign_update_t;
4080Sstevel@tonic-gate 
4090Sstevel@tonic-gate typedef struct crypto_sign_final {
4100Sstevel@tonic-gate 	uint_t			sf_return_value;
4110Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
4120Sstevel@tonic-gate 	size_t			sf_signlen;
4130Sstevel@tonic-gate 	caddr_t			sf_signbuf;
4140Sstevel@tonic-gate } crypto_sign_final_t;
4150Sstevel@tonic-gate 
4160Sstevel@tonic-gate typedef struct crypto_sign_recover_init {
4170Sstevel@tonic-gate 	uint_t			ri_return_value;
4180Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
4190Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
4200Sstevel@tonic-gate 	crypto_key_t		ri_key;
4210Sstevel@tonic-gate } crypto_sign_recover_init_t;
4220Sstevel@tonic-gate 
4230Sstevel@tonic-gate typedef struct crypto_sign_recover {
4240Sstevel@tonic-gate 	uint_t			sr_return_value;
4250Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
4260Sstevel@tonic-gate 	size_t			sr_datalen;
4270Sstevel@tonic-gate 	caddr_t			sr_databuf;
4280Sstevel@tonic-gate 	size_t			sr_signlen;
4290Sstevel@tonic-gate 	caddr_t			sr_signbuf;
4300Sstevel@tonic-gate } crypto_sign_recover_t;
4310Sstevel@tonic-gate 
4320Sstevel@tonic-gate typedef struct crypto_verify {
4330Sstevel@tonic-gate 	uint_t			cv_return_value;
4340Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
4350Sstevel@tonic-gate 	size_t			cv_datalen;
4360Sstevel@tonic-gate 	caddr_t			cv_databuf;
4370Sstevel@tonic-gate 	size_t			cv_signlen;
4380Sstevel@tonic-gate 	caddr_t			cv_signbuf;
4390Sstevel@tonic-gate } crypto_verify_t;
4400Sstevel@tonic-gate 
4410Sstevel@tonic-gate typedef struct crypto_verify_init {
4420Sstevel@tonic-gate 	uint_t			vi_return_value;
4430Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
4440Sstevel@tonic-gate 	crypto_mechanism_t	vi_mech;
4450Sstevel@tonic-gate 	crypto_key_t		vi_key;
4460Sstevel@tonic-gate } crypto_verify_init_t;
4470Sstevel@tonic-gate 
4480Sstevel@tonic-gate typedef struct crypto_verify_update {
4490Sstevel@tonic-gate 	uint_t			vu_return_value;
4500Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
4510Sstevel@tonic-gate 	size_t			vu_datalen;
4520Sstevel@tonic-gate 	caddr_t			vu_databuf;
4530Sstevel@tonic-gate } crypto_verify_update_t;
4540Sstevel@tonic-gate 
4550Sstevel@tonic-gate typedef struct crypto_verify_final {
4560Sstevel@tonic-gate 	uint_t			vf_return_value;
4570Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
4580Sstevel@tonic-gate 	size_t			vf_signlen;
4590Sstevel@tonic-gate 	caddr_t			vf_signbuf;
4600Sstevel@tonic-gate } crypto_verify_final_t;
4610Sstevel@tonic-gate 
4620Sstevel@tonic-gate typedef struct crypto_verify_recover_init {
4630Sstevel@tonic-gate 	uint_t			ri_return_value;
4640Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
4650Sstevel@tonic-gate 	crypto_mechanism_t	ri_mech;
4660Sstevel@tonic-gate 	crypto_key_t		ri_key;
4670Sstevel@tonic-gate } crypto_verify_recover_init_t;
4680Sstevel@tonic-gate 
4690Sstevel@tonic-gate typedef struct crypto_verify_recover {
4700Sstevel@tonic-gate 	uint_t			vr_return_value;
4710Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
4720Sstevel@tonic-gate 	size_t			vr_signlen;
4730Sstevel@tonic-gate 	caddr_t			vr_signbuf;
4740Sstevel@tonic-gate 	size_t			vr_datalen;
4750Sstevel@tonic-gate 	caddr_t			vr_databuf;
4760Sstevel@tonic-gate } crypto_verify_recover_t;
4770Sstevel@tonic-gate 
4780Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update {
4790Sstevel@tonic-gate 	uint_t			eu_return_value;
4800Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4810Sstevel@tonic-gate 	size_t			eu_datalen;
4820Sstevel@tonic-gate 	caddr_t			eu_databuf;
4830Sstevel@tonic-gate 	size_t			eu_encrlen;
4840Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
4850Sstevel@tonic-gate } crypto_digest_encrypt_update_t;
4860Sstevel@tonic-gate 
4870Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update {
4880Sstevel@tonic-gate 	uint_t			du_return_value;
4890Sstevel@tonic-gate 	crypto_session_id_t	du_session;
4900Sstevel@tonic-gate 	size_t			du_encrlen;
4910Sstevel@tonic-gate 	caddr_t			du_encrbuf;
4920Sstevel@tonic-gate 	size_t			du_datalen;
4930Sstevel@tonic-gate 	caddr_t			du_databuf;
4940Sstevel@tonic-gate } crypto_decrypt_digest_update_t;
4950Sstevel@tonic-gate 
4960Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update {
4970Sstevel@tonic-gate 	uint_t			eu_return_value;
4980Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
4990Sstevel@tonic-gate 	size_t			eu_datalen;
5000Sstevel@tonic-gate 	caddr_t			eu_databuf;
5010Sstevel@tonic-gate 	size_t			eu_encrlen;
5020Sstevel@tonic-gate 	caddr_t			eu_encrbuf;
5030Sstevel@tonic-gate } crypto_sign_encrypt_update_t;
5040Sstevel@tonic-gate 
5050Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update {
5060Sstevel@tonic-gate 	uint_t			vu_return_value;
5070Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
5080Sstevel@tonic-gate 	size_t			vu_encrlen;
5090Sstevel@tonic-gate 	caddr_t			vu_encrbuf;
5100Sstevel@tonic-gate 	size_t			vu_datalen;
5110Sstevel@tonic-gate 	caddr_t			vu_databuf;
5120Sstevel@tonic-gate } crypto_decrypt_verify_update_t;
5130Sstevel@tonic-gate 
5140Sstevel@tonic-gate #ifdef	_KERNEL
5150Sstevel@tonic-gate #ifdef	_SYSCALL32
5160Sstevel@tonic-gate 
5170Sstevel@tonic-gate typedef struct crypto_encrypt32 {
5180Sstevel@tonic-gate 	uint32_t		ce_return_value;
5190Sstevel@tonic-gate 	crypto_session_id_t	ce_session;
5200Sstevel@tonic-gate 	size32_t		ce_datalen;
5210Sstevel@tonic-gate 	caddr32_t		ce_databuf;
5220Sstevel@tonic-gate 	size32_t		ce_encrlen;
5230Sstevel@tonic-gate 	caddr32_t		ce_encrbuf;
5244632Smcpowers 	uint32_t		ce_flags;
5250Sstevel@tonic-gate } crypto_encrypt32_t;
5260Sstevel@tonic-gate 
5270Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5280Sstevel@tonic-gate #pragma pack(4)
5290Sstevel@tonic-gate #endif
5300Sstevel@tonic-gate 
5310Sstevel@tonic-gate typedef struct crypto_encrypt_init32 {
5320Sstevel@tonic-gate 	uint32_t		ei_return_value;
5330Sstevel@tonic-gate 	crypto_session_id_t	ei_session;
5340Sstevel@tonic-gate 	crypto_mechanism32_t	ei_mech;
5350Sstevel@tonic-gate 	crypto_key32_t		ei_key;
5360Sstevel@tonic-gate } crypto_encrypt_init32_t;
5370Sstevel@tonic-gate 
5380Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5390Sstevel@tonic-gate #pragma pack()
5400Sstevel@tonic-gate #endif
5410Sstevel@tonic-gate 
5420Sstevel@tonic-gate typedef struct crypto_encrypt_update32 {
5430Sstevel@tonic-gate 	uint32_t		eu_return_value;
5440Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
5450Sstevel@tonic-gate 	size32_t		eu_datalen;
5460Sstevel@tonic-gate 	caddr32_t		eu_databuf;
5470Sstevel@tonic-gate 	size32_t		eu_encrlen;
5480Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
54911030Sopensolaris@drydog.com 	uint_t			eu_flags;
5500Sstevel@tonic-gate } crypto_encrypt_update32_t;
5510Sstevel@tonic-gate 
5520Sstevel@tonic-gate typedef struct crypto_encrypt_final32 {
5530Sstevel@tonic-gate 	uint32_t		ef_return_value;
5540Sstevel@tonic-gate 	crypto_session_id_t	ef_session;
5550Sstevel@tonic-gate 	size32_t		ef_encrlen;
5560Sstevel@tonic-gate 	caddr32_t		ef_encrbuf;
5570Sstevel@tonic-gate } crypto_encrypt_final32_t;
5580Sstevel@tonic-gate 
5590Sstevel@tonic-gate typedef struct crypto_decrypt32 {
5600Sstevel@tonic-gate 	uint32_t		cd_return_value;
5610Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
5620Sstevel@tonic-gate 	size32_t		cd_encrlen;
5630Sstevel@tonic-gate 	caddr32_t		cd_encrbuf;
5640Sstevel@tonic-gate 	size32_t		cd_datalen;
5650Sstevel@tonic-gate 	caddr32_t		cd_databuf;
5664632Smcpowers 	uint32_t		cd_flags;
5670Sstevel@tonic-gate } crypto_decrypt32_t;
5680Sstevel@tonic-gate 
5690Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5700Sstevel@tonic-gate #pragma pack(4)
5710Sstevel@tonic-gate #endif
5720Sstevel@tonic-gate 
5730Sstevel@tonic-gate typedef struct crypto_decrypt_init32 {
5740Sstevel@tonic-gate 	uint32_t		di_return_value;
5750Sstevel@tonic-gate 	crypto_session_id_t	di_session;
5760Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
5770Sstevel@tonic-gate 	crypto_key32_t		di_key;
5780Sstevel@tonic-gate } crypto_decrypt_init32_t;
5790Sstevel@tonic-gate 
5800Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
5810Sstevel@tonic-gate #pragma pack()
5820Sstevel@tonic-gate #endif
5830Sstevel@tonic-gate 
5840Sstevel@tonic-gate typedef struct crypto_decrypt_update32 {
5850Sstevel@tonic-gate 	uint32_t		du_return_value;
5860Sstevel@tonic-gate 	crypto_session_id_t	du_session;
5870Sstevel@tonic-gate 	size32_t		du_encrlen;
5880Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
5890Sstevel@tonic-gate 	size32_t		du_datalen;
5900Sstevel@tonic-gate 	caddr32_t		du_databuf;
59111030Sopensolaris@drydog.com 	uint_t			du_flags;
5920Sstevel@tonic-gate } crypto_decrypt_update32_t;
5930Sstevel@tonic-gate 
5940Sstevel@tonic-gate typedef struct crypto_decrypt_final32 {
5950Sstevel@tonic-gate 	uint32_t		df_return_value;
5960Sstevel@tonic-gate 	crypto_session_id_t	df_session;
5970Sstevel@tonic-gate 	size32_t		df_datalen;
5980Sstevel@tonic-gate 	caddr32_t		df_databuf;
5990Sstevel@tonic-gate } crypto_decrypt_final32_t;
6000Sstevel@tonic-gate 
6010Sstevel@tonic-gate typedef struct crypto_digest32 {
6020Sstevel@tonic-gate 	uint32_t		cd_return_value;
6030Sstevel@tonic-gate 	crypto_session_id_t	cd_session;
6040Sstevel@tonic-gate 	size32_t		cd_datalen;
6050Sstevel@tonic-gate 	caddr32_t		cd_databuf;
6060Sstevel@tonic-gate 	size32_t		cd_digestlen;
6070Sstevel@tonic-gate 	caddr32_t		cd_digestbuf;
6080Sstevel@tonic-gate } crypto_digest32_t;
6090Sstevel@tonic-gate 
6100Sstevel@tonic-gate typedef struct crypto_digest_init32 {
6110Sstevel@tonic-gate 	uint32_t		di_return_value;
6120Sstevel@tonic-gate 	crypto_session_id_t	di_session;
6130Sstevel@tonic-gate 	crypto_mechanism32_t	di_mech;
6140Sstevel@tonic-gate } crypto_digest_init32_t;
6150Sstevel@tonic-gate 
6160Sstevel@tonic-gate typedef struct crypto_digest_update32 {
6170Sstevel@tonic-gate 	uint32_t		du_return_value;
6180Sstevel@tonic-gate 	crypto_session_id_t	du_session;
6190Sstevel@tonic-gate 	size32_t		du_datalen;
6200Sstevel@tonic-gate 	caddr32_t		du_databuf;
6210Sstevel@tonic-gate } crypto_digest_update32_t;
6220Sstevel@tonic-gate 
6230Sstevel@tonic-gate typedef struct crypto_digest_key32 {
6240Sstevel@tonic-gate 	uint32_t		dk_return_value;
6250Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
6260Sstevel@tonic-gate 	crypto_key32_t		dk_key;
6270Sstevel@tonic-gate } crypto_digest_key32_t;
6280Sstevel@tonic-gate 
6290Sstevel@tonic-gate typedef struct crypto_digest_final32 {
6300Sstevel@tonic-gate 	uint32_t		df_return_value;
6310Sstevel@tonic-gate 	crypto_session_id_t	df_session;
6320Sstevel@tonic-gate 	size32_t		df_digestlen;
6330Sstevel@tonic-gate 	caddr32_t		df_digestbuf;
6340Sstevel@tonic-gate } crypto_digest_final32_t;
6350Sstevel@tonic-gate 
6360Sstevel@tonic-gate typedef struct crypto_mac32 {
6370Sstevel@tonic-gate 	uint32_t		cm_return_value;
6380Sstevel@tonic-gate 	crypto_session_id_t	cm_session;
6390Sstevel@tonic-gate 	size32_t		cm_datalen;
6400Sstevel@tonic-gate 	caddr32_t		cm_databuf;
6410Sstevel@tonic-gate 	size32_t		cm_maclen;
6420Sstevel@tonic-gate 	caddr32_t		cm_macbuf;
6430Sstevel@tonic-gate } crypto_mac32_t;
6440Sstevel@tonic-gate 
6450Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6460Sstevel@tonic-gate #pragma pack(4)
6470Sstevel@tonic-gate #endif
6480Sstevel@tonic-gate 
6490Sstevel@tonic-gate typedef struct crypto_mac_init32 {
6500Sstevel@tonic-gate 	uint32_t		mi_return_value;
6510Sstevel@tonic-gate 	crypto_session_id_t	mi_session;
6520Sstevel@tonic-gate 	crypto_mechanism32_t	mi_mech;
6530Sstevel@tonic-gate 	crypto_key32_t		mi_key;
6540Sstevel@tonic-gate } crypto_mac_init32_t;
6550Sstevel@tonic-gate 
6560Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6570Sstevel@tonic-gate #pragma pack()
6580Sstevel@tonic-gate #endif
6590Sstevel@tonic-gate 
6600Sstevel@tonic-gate typedef struct crypto_mac_update32 {
6610Sstevel@tonic-gate 	uint32_t		mu_return_value;
6620Sstevel@tonic-gate 	crypto_session_id_t	mu_session;
6630Sstevel@tonic-gate 	size32_t		mu_datalen;
6640Sstevel@tonic-gate 	caddr32_t		mu_databuf;
6650Sstevel@tonic-gate } crypto_mac_update32_t;
6660Sstevel@tonic-gate 
6670Sstevel@tonic-gate typedef struct crypto_mac_final32 {
6680Sstevel@tonic-gate 	uint32_t		mf_return_value;
6690Sstevel@tonic-gate 	crypto_session_id_t	mf_session;
6700Sstevel@tonic-gate 	size32_t		mf_maclen;
6710Sstevel@tonic-gate 	caddr32_t		mf_macbuf;
6720Sstevel@tonic-gate } crypto_mac_final32_t;
6730Sstevel@tonic-gate 
6740Sstevel@tonic-gate typedef struct crypto_sign32 {
6750Sstevel@tonic-gate 	uint32_t		cs_return_value;
6760Sstevel@tonic-gate 	crypto_session_id_t	cs_session;
6770Sstevel@tonic-gate 	size32_t		cs_datalen;
6780Sstevel@tonic-gate 	caddr32_t		cs_databuf;
6790Sstevel@tonic-gate 	size32_t		cs_signlen;
6800Sstevel@tonic-gate 	caddr32_t		cs_signbuf;
6810Sstevel@tonic-gate } crypto_sign32_t;
6820Sstevel@tonic-gate 
6830Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6840Sstevel@tonic-gate #pragma pack(4)
6850Sstevel@tonic-gate #endif
6860Sstevel@tonic-gate 
6870Sstevel@tonic-gate typedef struct crypto_sign_init32 {
6880Sstevel@tonic-gate 	uint32_t		si_return_value;
6890Sstevel@tonic-gate 	crypto_session_id_t	si_session;
6900Sstevel@tonic-gate 	crypto_mechanism32_t	si_mech;
6910Sstevel@tonic-gate 	crypto_key32_t		si_key;
6920Sstevel@tonic-gate } crypto_sign_init32_t;
6930Sstevel@tonic-gate 
6940Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
6950Sstevel@tonic-gate #pragma pack()
6960Sstevel@tonic-gate #endif
6970Sstevel@tonic-gate 
6980Sstevel@tonic-gate typedef struct crypto_sign_update32 {
6990Sstevel@tonic-gate 	uint32_t		su_return_value;
7000Sstevel@tonic-gate 	crypto_session_id_t	su_session;
7010Sstevel@tonic-gate 	size32_t		su_datalen;
7020Sstevel@tonic-gate 	caddr32_t		su_databuf;
7030Sstevel@tonic-gate } crypto_sign_update32_t;
7040Sstevel@tonic-gate 
7050Sstevel@tonic-gate typedef struct crypto_sign_final32 {
7060Sstevel@tonic-gate 	uint32_t		sf_return_value;
7070Sstevel@tonic-gate 	crypto_session_id_t	sf_session;
7080Sstevel@tonic-gate 	size32_t		sf_signlen;
7090Sstevel@tonic-gate 	caddr32_t		sf_signbuf;
7100Sstevel@tonic-gate } crypto_sign_final32_t;
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7130Sstevel@tonic-gate #pragma pack(4)
7140Sstevel@tonic-gate #endif
7150Sstevel@tonic-gate 
7160Sstevel@tonic-gate typedef struct crypto_sign_recover_init32 {
7170Sstevel@tonic-gate 	uint32_t		ri_return_value;
7180Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
7190Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
7200Sstevel@tonic-gate 	crypto_key32_t		ri_key;
7210Sstevel@tonic-gate } crypto_sign_recover_init32_t;
7220Sstevel@tonic-gate 
7230Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7240Sstevel@tonic-gate #pragma pack()
7250Sstevel@tonic-gate #endif
7260Sstevel@tonic-gate 
7270Sstevel@tonic-gate typedef struct crypto_sign_recover32 {
7280Sstevel@tonic-gate 	uint32_t		sr_return_value;
7290Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
7300Sstevel@tonic-gate 	size32_t		sr_datalen;
7310Sstevel@tonic-gate 	caddr32_t		sr_databuf;
7320Sstevel@tonic-gate 	size32_t		sr_signlen;
7330Sstevel@tonic-gate 	caddr32_t		sr_signbuf;
7340Sstevel@tonic-gate } crypto_sign_recover32_t;
7350Sstevel@tonic-gate 
7360Sstevel@tonic-gate typedef struct crypto_verify32 {
7370Sstevel@tonic-gate 	uint32_t		cv_return_value;
7380Sstevel@tonic-gate 	crypto_session_id_t	cv_session;
7390Sstevel@tonic-gate 	size32_t		cv_datalen;
7400Sstevel@tonic-gate 	caddr32_t		cv_databuf;
7410Sstevel@tonic-gate 	size32_t		cv_signlen;
7420Sstevel@tonic-gate 	caddr32_t		cv_signbuf;
7430Sstevel@tonic-gate } crypto_verify32_t;
7440Sstevel@tonic-gate 
7450Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7460Sstevel@tonic-gate #pragma pack(4)
7470Sstevel@tonic-gate #endif
7480Sstevel@tonic-gate 
7490Sstevel@tonic-gate typedef struct crypto_verify_init32 {
7500Sstevel@tonic-gate 	uint32_t		vi_return_value;
7510Sstevel@tonic-gate 	crypto_session_id_t	vi_session;
7520Sstevel@tonic-gate 	crypto_mechanism32_t	vi_mech;
7530Sstevel@tonic-gate 	crypto_key32_t		vi_key;
7540Sstevel@tonic-gate } crypto_verify_init32_t;
7550Sstevel@tonic-gate 
7560Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7570Sstevel@tonic-gate #pragma pack()
7580Sstevel@tonic-gate #endif
7590Sstevel@tonic-gate 
7600Sstevel@tonic-gate typedef struct crypto_verify_update32 {
7610Sstevel@tonic-gate 	uint32_t		vu_return_value;
7620Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
7630Sstevel@tonic-gate 	size32_t		vu_datalen;
7640Sstevel@tonic-gate 	caddr32_t		vu_databuf;
7650Sstevel@tonic-gate } crypto_verify_update32_t;
7660Sstevel@tonic-gate 
7670Sstevel@tonic-gate typedef struct crypto_verify_final32 {
7680Sstevel@tonic-gate 	uint32_t		vf_return_value;
7690Sstevel@tonic-gate 	crypto_session_id_t	vf_session;
7700Sstevel@tonic-gate 	size32_t		vf_signlen;
7710Sstevel@tonic-gate 	caddr32_t		vf_signbuf;
7720Sstevel@tonic-gate } crypto_verify_final32_t;
7730Sstevel@tonic-gate 
7740Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7750Sstevel@tonic-gate #pragma pack(4)
7760Sstevel@tonic-gate #endif
7770Sstevel@tonic-gate 
7780Sstevel@tonic-gate typedef struct crypto_verify_recover_init32 {
7790Sstevel@tonic-gate 	uint32_t		ri_return_value;
7800Sstevel@tonic-gate 	crypto_session_id_t	ri_session;
7810Sstevel@tonic-gate 	crypto_mechanism32_t	ri_mech;
7820Sstevel@tonic-gate 	crypto_key32_t		ri_key;
7830Sstevel@tonic-gate } crypto_verify_recover_init32_t;
7840Sstevel@tonic-gate 
7850Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
7860Sstevel@tonic-gate #pragma pack()
7870Sstevel@tonic-gate #endif
7880Sstevel@tonic-gate 
7890Sstevel@tonic-gate typedef struct crypto_verify_recover32 {
7900Sstevel@tonic-gate 	uint32_t		vr_return_value;
7910Sstevel@tonic-gate 	crypto_session_id_t	vr_session;
7920Sstevel@tonic-gate 	size32_t		vr_signlen;
7930Sstevel@tonic-gate 	caddr32_t		vr_signbuf;
7940Sstevel@tonic-gate 	size32_t		vr_datalen;
7950Sstevel@tonic-gate 	caddr32_t		vr_databuf;
7960Sstevel@tonic-gate } crypto_verify_recover32_t;
7970Sstevel@tonic-gate 
7980Sstevel@tonic-gate typedef struct crypto_digest_encrypt_update32 {
7990Sstevel@tonic-gate 	uint32_t		eu_return_value;
8000Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
8010Sstevel@tonic-gate 	size32_t		eu_datalen;
8020Sstevel@tonic-gate 	caddr32_t		eu_databuf;
8030Sstevel@tonic-gate 	size32_t		eu_encrlen;
8040Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
8050Sstevel@tonic-gate } crypto_digest_encrypt_update32_t;
8060Sstevel@tonic-gate 
8070Sstevel@tonic-gate typedef struct crypto_decrypt_digest_update32 {
8080Sstevel@tonic-gate 	uint32_t		du_return_value;
8090Sstevel@tonic-gate 	crypto_session_id_t	du_session;
8100Sstevel@tonic-gate 	size32_t		du_encrlen;
8110Sstevel@tonic-gate 	caddr32_t		du_encrbuf;
8120Sstevel@tonic-gate 	size32_t		du_datalen;
8130Sstevel@tonic-gate 	caddr32_t		du_databuf;
8140Sstevel@tonic-gate } crypto_decrypt_digest_update32_t;
8150Sstevel@tonic-gate 
8160Sstevel@tonic-gate typedef struct crypto_sign_encrypt_update32 {
8170Sstevel@tonic-gate 	uint32_t		eu_return_value;
8180Sstevel@tonic-gate 	crypto_session_id_t	eu_session;
8190Sstevel@tonic-gate 	size32_t		eu_datalen;
8200Sstevel@tonic-gate 	caddr32_t		eu_databuf;
8210Sstevel@tonic-gate 	size32_t		eu_encrlen;
8220Sstevel@tonic-gate 	caddr32_t		eu_encrbuf;
8230Sstevel@tonic-gate } crypto_sign_encrypt_update32_t;
8240Sstevel@tonic-gate 
8250Sstevel@tonic-gate typedef struct crypto_decrypt_verify_update32 {
8260Sstevel@tonic-gate 	uint32_t		vu_return_value;
8270Sstevel@tonic-gate 	crypto_session_id_t	vu_session;
8280Sstevel@tonic-gate 	size32_t		vu_encrlen;
8290Sstevel@tonic-gate 	caddr32_t		vu_encrbuf;
8300Sstevel@tonic-gate 	size32_t		vu_datalen;
8310Sstevel@tonic-gate 	caddr32_t		vu_databuf;
8320Sstevel@tonic-gate } crypto_decrypt_verify_update32_t;
8330Sstevel@tonic-gate 
8340Sstevel@tonic-gate #endif	/* _SYSCALL32 */
8350Sstevel@tonic-gate #endif	/* _KERNEL */
8360Sstevel@tonic-gate 
8370Sstevel@tonic-gate #define	CRYPTO_ENCRYPT			CRYPTO(50)
8380Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_INIT		CRYPTO(51)
8390Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_UPDATE		CRYPTO(52)
8400Sstevel@tonic-gate #define	CRYPTO_ENCRYPT_FINAL		CRYPTO(53)
8410Sstevel@tonic-gate #define	CRYPTO_DECRYPT			CRYPTO(54)
8420Sstevel@tonic-gate #define	CRYPTO_DECRYPT_INIT		CRYPTO(55)
8430Sstevel@tonic-gate #define	CRYPTO_DECRYPT_UPDATE		CRYPTO(56)
8440Sstevel@tonic-gate #define	CRYPTO_DECRYPT_FINAL		CRYPTO(57)
8450Sstevel@tonic-gate 
8460Sstevel@tonic-gate #define	CRYPTO_DIGEST			CRYPTO(58)
8470Sstevel@tonic-gate #define	CRYPTO_DIGEST_INIT		CRYPTO(59)
8480Sstevel@tonic-gate #define	CRYPTO_DIGEST_UPDATE		CRYPTO(60)
8490Sstevel@tonic-gate #define	CRYPTO_DIGEST_KEY		CRYPTO(61)
8500Sstevel@tonic-gate #define	CRYPTO_DIGEST_FINAL		CRYPTO(62)
8510Sstevel@tonic-gate #define	CRYPTO_MAC			CRYPTO(63)
8520Sstevel@tonic-gate #define	CRYPTO_MAC_INIT			CRYPTO(64)
8530Sstevel@tonic-gate #define	CRYPTO_MAC_UPDATE		CRYPTO(65)
8540Sstevel@tonic-gate #define	CRYPTO_MAC_FINAL		CRYPTO(66)
8550Sstevel@tonic-gate 
8560Sstevel@tonic-gate #define	CRYPTO_SIGN			CRYPTO(67)
8570Sstevel@tonic-gate #define	CRYPTO_SIGN_INIT		CRYPTO(68)
8580Sstevel@tonic-gate #define	CRYPTO_SIGN_UPDATE		CRYPTO(69)
8590Sstevel@tonic-gate #define	CRYPTO_SIGN_FINAL		CRYPTO(70)
8600Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER_INIT	CRYPTO(71)
8610Sstevel@tonic-gate #define	CRYPTO_SIGN_RECOVER		CRYPTO(72)
8620Sstevel@tonic-gate #define	CRYPTO_VERIFY			CRYPTO(73)
8630Sstevel@tonic-gate #define	CRYPTO_VERIFY_INIT		CRYPTO(74)
8640Sstevel@tonic-gate #define	CRYPTO_VERIFY_UPDATE		CRYPTO(75)
8650Sstevel@tonic-gate #define	CRYPTO_VERIFY_FINAL		CRYPTO(76)
8660Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER_INIT	CRYPTO(77)
8670Sstevel@tonic-gate #define	CRYPTO_VERIFY_RECOVER		CRYPTO(78)
8680Sstevel@tonic-gate 
8690Sstevel@tonic-gate #define	CRYPTO_DIGEST_ENCRYPT_UPDATE	CRYPTO(79)
8700Sstevel@tonic-gate #define	CRYPTO_DECRYPT_DIGEST_UPDATE	CRYPTO(80)
8710Sstevel@tonic-gate #define	CRYPTO_SIGN_ENCRYPT_UPDATE	CRYPTO(81)
8720Sstevel@tonic-gate #define	CRYPTO_DECRYPT_VERIFY_UPDATE	CRYPTO(82)
8730Sstevel@tonic-gate 
8740Sstevel@tonic-gate /*
8750Sstevel@tonic-gate  * Random Number Ioctls
8760Sstevel@tonic-gate  */
8770Sstevel@tonic-gate typedef struct crypto_seed_random {
8780Sstevel@tonic-gate 	uint_t			sr_return_value;
8790Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8800Sstevel@tonic-gate 	size_t			sr_seedlen;
8810Sstevel@tonic-gate 	caddr_t			sr_seedbuf;
8820Sstevel@tonic-gate } crypto_seed_random_t;
8830Sstevel@tonic-gate 
8840Sstevel@tonic-gate typedef struct crypto_generate_random {
8850Sstevel@tonic-gate 	uint_t			gr_return_value;
8860Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
8870Sstevel@tonic-gate 	caddr_t			gr_buf;
8880Sstevel@tonic-gate 	size_t			gr_buflen;
8890Sstevel@tonic-gate } crypto_generate_random_t;
8900Sstevel@tonic-gate 
8910Sstevel@tonic-gate #ifdef	_KERNEL
8920Sstevel@tonic-gate #ifdef	_SYSCALL32
8930Sstevel@tonic-gate 
8940Sstevel@tonic-gate typedef struct crypto_seed_random32 {
8950Sstevel@tonic-gate 	uint32_t		sr_return_value;
8960Sstevel@tonic-gate 	crypto_session_id_t	sr_session;
8970Sstevel@tonic-gate 	size32_t		sr_seedlen;
8980Sstevel@tonic-gate 	caddr32_t		sr_seedbuf;
8990Sstevel@tonic-gate } crypto_seed_random32_t;
9000Sstevel@tonic-gate 
9010Sstevel@tonic-gate typedef struct crypto_generate_random32 {
9020Sstevel@tonic-gate 	uint32_t		gr_return_value;
9030Sstevel@tonic-gate 	crypto_session_id_t	gr_session;
9040Sstevel@tonic-gate 	caddr32_t		gr_buf;
9050Sstevel@tonic-gate 	size32_t		gr_buflen;
9060Sstevel@tonic-gate } crypto_generate_random32_t;
9070Sstevel@tonic-gate 
9080Sstevel@tonic-gate #endif	/* _SYSCALL32 */
9090Sstevel@tonic-gate #endif	/* _KERNEL */
9100Sstevel@tonic-gate 
9110Sstevel@tonic-gate #define	CRYPTO_SEED_RANDOM		CRYPTO(90)
9120Sstevel@tonic-gate #define	CRYPTO_GENERATE_RANDOM		CRYPTO(91)
9130Sstevel@tonic-gate 
9140Sstevel@tonic-gate /*
9150Sstevel@tonic-gate  * Object Management Ioctls
9160Sstevel@tonic-gate  */
9170Sstevel@tonic-gate typedef struct crypto_object_create {
9180Sstevel@tonic-gate 	uint_t			oc_return_value;
9190Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9200Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9210Sstevel@tonic-gate 	uint_t			oc_count;
9220Sstevel@tonic-gate 	caddr_t			oc_attributes;
9230Sstevel@tonic-gate } crypto_object_create_t;
9240Sstevel@tonic-gate 
9250Sstevel@tonic-gate typedef struct crypto_object_copy {
9260Sstevel@tonic-gate 	uint_t			oc_return_value;
9270Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9280Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9290Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
9300Sstevel@tonic-gate 	uint_t			oc_count;
9310Sstevel@tonic-gate 	caddr_t			oc_new_attributes;
9320Sstevel@tonic-gate } crypto_object_copy_t;
9330Sstevel@tonic-gate 
9340Sstevel@tonic-gate typedef struct crypto_object_destroy {
9350Sstevel@tonic-gate 	uint_t			od_return_value;
9360Sstevel@tonic-gate 	crypto_session_id_t	od_session;
9370Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
9380Sstevel@tonic-gate } crypto_object_destroy_t;
9390Sstevel@tonic-gate 
9400Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value {
9410Sstevel@tonic-gate 	uint_t			og_return_value;
9420Sstevel@tonic-gate 	crypto_session_id_t	og_session;
9430Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
9440Sstevel@tonic-gate 	uint_t			og_count;
9450Sstevel@tonic-gate 	caddr_t			og_attributes;
9460Sstevel@tonic-gate } crypto_object_get_attribute_value_t;
9470Sstevel@tonic-gate 
9480Sstevel@tonic-gate typedef struct crypto_object_get_size {
9490Sstevel@tonic-gate 	uint_t			gs_return_value;
9500Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
9510Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
9520Sstevel@tonic-gate 	size_t			gs_size;
9530Sstevel@tonic-gate } crypto_object_get_size_t;
9540Sstevel@tonic-gate 
9550Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value {
9560Sstevel@tonic-gate 	uint_t			sa_return_value;
9570Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
9580Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
9590Sstevel@tonic-gate 	uint_t			sa_count;
9600Sstevel@tonic-gate 	caddr_t			sa_attributes;
9610Sstevel@tonic-gate } crypto_object_set_attribute_value_t;
9620Sstevel@tonic-gate 
9630Sstevel@tonic-gate typedef struct crypto_object_find_init {
9640Sstevel@tonic-gate 	uint_t			fi_return_value;
9650Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
9660Sstevel@tonic-gate 	uint_t			fi_count;
9670Sstevel@tonic-gate 	caddr_t			fi_attributes;
9680Sstevel@tonic-gate } crypto_object_find_init_t;
9690Sstevel@tonic-gate 
9700Sstevel@tonic-gate typedef struct crypto_object_find_update {
9710Sstevel@tonic-gate 	uint_t			fu_return_value;
9720Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
9730Sstevel@tonic-gate 	uint_t			fu_max_count;
9740Sstevel@tonic-gate 	uint_t			fu_count;
9750Sstevel@tonic-gate 	caddr_t			fu_handles;
9760Sstevel@tonic-gate } crypto_object_find_update_t;
9770Sstevel@tonic-gate 
9780Sstevel@tonic-gate typedef struct crypto_object_find_final {
9790Sstevel@tonic-gate 	uint_t			ff_return_value;
9800Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
9810Sstevel@tonic-gate } crypto_object_find_final_t;
9820Sstevel@tonic-gate 
9830Sstevel@tonic-gate #ifdef	_KERNEL
9840Sstevel@tonic-gate #ifdef	_SYSCALL32
9850Sstevel@tonic-gate 
9860Sstevel@tonic-gate typedef struct crypto_object_create32 {
9870Sstevel@tonic-gate 	uint32_t		oc_return_value;
9880Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9890Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9900Sstevel@tonic-gate 	uint32_t		oc_count;
9910Sstevel@tonic-gate 	caddr32_t		oc_attributes;
9920Sstevel@tonic-gate } crypto_object_create32_t;
9930Sstevel@tonic-gate 
9940Sstevel@tonic-gate typedef struct crypto_object_copy32 {
9950Sstevel@tonic-gate 	uint32_t		oc_return_value;
9960Sstevel@tonic-gate 	crypto_session_id_t	oc_session;
9970Sstevel@tonic-gate 	crypto_object_id_t	oc_handle;
9980Sstevel@tonic-gate 	crypto_object_id_t	oc_new_handle;
9990Sstevel@tonic-gate 	uint32_t		oc_count;
10000Sstevel@tonic-gate 	caddr32_t		oc_new_attributes;
10010Sstevel@tonic-gate } crypto_object_copy32_t;
10020Sstevel@tonic-gate 
10030Sstevel@tonic-gate typedef struct crypto_object_destroy32 {
10040Sstevel@tonic-gate 	uint32_t		od_return_value;
10050Sstevel@tonic-gate 	crypto_session_id_t	od_session;
10060Sstevel@tonic-gate 	crypto_object_id_t	od_handle;
10070Sstevel@tonic-gate } crypto_object_destroy32_t;
10080Sstevel@tonic-gate 
10090Sstevel@tonic-gate typedef struct crypto_object_get_attribute_value32 {
10100Sstevel@tonic-gate 	uint32_t		og_return_value;
10110Sstevel@tonic-gate 	crypto_session_id_t	og_session;
10120Sstevel@tonic-gate 	crypto_object_id_t	og_handle;
10130Sstevel@tonic-gate 	uint32_t		og_count;
10140Sstevel@tonic-gate 	caddr32_t		og_attributes;
10150Sstevel@tonic-gate } crypto_object_get_attribute_value32_t;
10160Sstevel@tonic-gate 
10170Sstevel@tonic-gate typedef struct crypto_object_get_size32 {
10180Sstevel@tonic-gate 	uint32_t		gs_return_value;
10190Sstevel@tonic-gate 	crypto_session_id_t	gs_session;
10200Sstevel@tonic-gate 	crypto_object_id_t	gs_handle;
10210Sstevel@tonic-gate 	size32_t		gs_size;
10220Sstevel@tonic-gate } crypto_object_get_size32_t;
10230Sstevel@tonic-gate 
10240Sstevel@tonic-gate typedef struct crypto_object_set_attribute_value32 {
10250Sstevel@tonic-gate 	uint32_t		sa_return_value;
10260Sstevel@tonic-gate 	crypto_session_id_t	sa_session;
10270Sstevel@tonic-gate 	crypto_object_id_t	sa_handle;
10280Sstevel@tonic-gate 	uint32_t		sa_count;
10290Sstevel@tonic-gate 	caddr32_t		sa_attributes;
10300Sstevel@tonic-gate } crypto_object_set_attribute_value32_t;
10310Sstevel@tonic-gate 
10320Sstevel@tonic-gate typedef struct crypto_object_find_init32 {
10330Sstevel@tonic-gate 	uint32_t		fi_return_value;
10340Sstevel@tonic-gate 	crypto_session_id_t	fi_session;
10350Sstevel@tonic-gate 	uint32_t		fi_count;
10360Sstevel@tonic-gate 	caddr32_t		fi_attributes;
10370Sstevel@tonic-gate } crypto_object_find_init32_t;
10380Sstevel@tonic-gate 
10390Sstevel@tonic-gate typedef struct crypto_object_find_update32 {
10400Sstevel@tonic-gate 	uint32_t		fu_return_value;
10410Sstevel@tonic-gate 	crypto_session_id_t	fu_session;
10420Sstevel@tonic-gate 	uint32_t		fu_max_count;
10430Sstevel@tonic-gate 	uint32_t		fu_count;
10440Sstevel@tonic-gate 	caddr32_t		fu_handles;
10450Sstevel@tonic-gate } crypto_object_find_update32_t;
10460Sstevel@tonic-gate 
10470Sstevel@tonic-gate typedef struct crypto_object_find_final32 {
10480Sstevel@tonic-gate 	uint32_t		ff_return_value;
10490Sstevel@tonic-gate 	crypto_session_id_t	ff_session;
10500Sstevel@tonic-gate } crypto_object_find_final32_t;
10510Sstevel@tonic-gate 
10520Sstevel@tonic-gate #endif	/* _SYSCALL32 */
10530Sstevel@tonic-gate #endif	/* _KERNEL */
10540Sstevel@tonic-gate 
10550Sstevel@tonic-gate #define	CRYPTO_OBJECT_CREATE			CRYPTO(100)
10560Sstevel@tonic-gate #define	CRYPTO_OBJECT_COPY			CRYPTO(101)
10570Sstevel@tonic-gate #define	CRYPTO_OBJECT_DESTROY			CRYPTO(102)
10580Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_ATTRIBUTE_VALUE	CRYPTO(103)
10590Sstevel@tonic-gate #define	CRYPTO_OBJECT_GET_SIZE			CRYPTO(104)
10600Sstevel@tonic-gate #define	CRYPTO_OBJECT_SET_ATTRIBUTE_VALUE	CRYPTO(105)
10610Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_INIT			CRYPTO(106)
10620Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_UPDATE		CRYPTO(107)
10630Sstevel@tonic-gate #define	CRYPTO_OBJECT_FIND_FINAL		CRYPTO(108)
10640Sstevel@tonic-gate 
10650Sstevel@tonic-gate /*
10660Sstevel@tonic-gate  * Key Generation Ioctls
10670Sstevel@tonic-gate  */
10680Sstevel@tonic-gate typedef struct crypto_object_generate_key {
10690Sstevel@tonic-gate 	uint_t			gk_return_value;
10700Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
10710Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
10720Sstevel@tonic-gate 	crypto_mechanism_t	gk_mechanism;
10730Sstevel@tonic-gate 	uint_t			gk_count;
10740Sstevel@tonic-gate 	caddr_t			gk_attributes;
10750Sstevel@tonic-gate } crypto_object_generate_key_t;
10760Sstevel@tonic-gate 
10770Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair {
10780Sstevel@tonic-gate 	uint_t			kp_return_value;
10790Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
10800Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
10810Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
10820Sstevel@tonic-gate 	uint_t			kp_public_count;
10830Sstevel@tonic-gate 	uint_t			kp_private_count;
10840Sstevel@tonic-gate 	caddr_t			kp_public_attributes;
10850Sstevel@tonic-gate 	caddr_t			kp_private_attributes;
10860Sstevel@tonic-gate 	crypto_mechanism_t	kp_mechanism;
10870Sstevel@tonic-gate } crypto_object_generate_key_pair_t;
10880Sstevel@tonic-gate 
10890Sstevel@tonic-gate typedef struct crypto_object_wrap_key {
10900Sstevel@tonic-gate 	uint_t			wk_return_value;
10910Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
10920Sstevel@tonic-gate 	crypto_mechanism_t	wk_mechanism;
10930Sstevel@tonic-gate 	crypto_key_t		wk_wrapping_key;
10940Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
10950Sstevel@tonic-gate 	size_t			wk_wrapped_key_len;
10960Sstevel@tonic-gate 	caddr_t			wk_wrapped_key;
10970Sstevel@tonic-gate } crypto_object_wrap_key_t;
10980Sstevel@tonic-gate 
10990Sstevel@tonic-gate typedef struct crypto_object_unwrap_key {
11000Sstevel@tonic-gate 	uint_t			uk_return_value;
11010Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
11020Sstevel@tonic-gate 	crypto_mechanism_t	uk_mechanism;
11030Sstevel@tonic-gate 	crypto_key_t		uk_unwrapping_key;
11040Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
11050Sstevel@tonic-gate 	size_t			uk_wrapped_key_len;
11060Sstevel@tonic-gate 	caddr_t			uk_wrapped_key;
11070Sstevel@tonic-gate 	uint_t			uk_count;
11080Sstevel@tonic-gate 	caddr_t			uk_attributes;
11090Sstevel@tonic-gate } crypto_object_unwrap_key_t;
11100Sstevel@tonic-gate 
11110Sstevel@tonic-gate typedef struct crypto_derive_key {
11120Sstevel@tonic-gate 	uint_t			dk_return_value;
11130Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
11140Sstevel@tonic-gate 	crypto_mechanism_t	dk_mechanism;
11150Sstevel@tonic-gate 	crypto_key_t		dk_base_key;
11160Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
11170Sstevel@tonic-gate 	uint_t			dk_count;
11180Sstevel@tonic-gate 	caddr_t			dk_attributes;
11190Sstevel@tonic-gate } crypto_derive_key_t;
11200Sstevel@tonic-gate 
11210Sstevel@tonic-gate #ifdef	_KERNEL
11220Sstevel@tonic-gate #ifdef	_SYSCALL32
11230Sstevel@tonic-gate 
11240Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
11250Sstevel@tonic-gate #pragma pack(4)
11260Sstevel@tonic-gate #endif
11270Sstevel@tonic-gate 
11280Sstevel@tonic-gate typedef struct crypto_object_generate_key32 {
11290Sstevel@tonic-gate 	uint32_t		gk_return_value;
11300Sstevel@tonic-gate 	crypto_session_id_t	gk_session;
11310Sstevel@tonic-gate 	crypto_object_id_t	gk_handle;
11320Sstevel@tonic-gate 	crypto_mechanism32_t	gk_mechanism;
11330Sstevel@tonic-gate 	uint32_t		gk_count;
11340Sstevel@tonic-gate 	caddr32_t		gk_attributes;
11350Sstevel@tonic-gate } crypto_object_generate_key32_t;
11360Sstevel@tonic-gate 
11370Sstevel@tonic-gate #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
11380Sstevel@tonic-gate #pragma pack()
11390Sstevel@tonic-gate #endif
11400Sstevel@tonic-gate 
11410Sstevel@tonic-gate typedef struct crypto_object_generate_key_pair32 {
11420Sstevel@tonic-gate 	uint32_t		kp_return_value;
11430Sstevel@tonic-gate 	crypto_session_id_t	kp_session;
11440Sstevel@tonic-gate 	crypto_object_id_t	kp_public_handle;
11450Sstevel@tonic-gate 	crypto_object_id_t	kp_private_handle;
11460Sstevel@tonic-gate 	uint32_t		kp_public_count;
11470Sstevel@tonic-gate 	uint32_t		kp_private_count;
11480Sstevel@tonic-gate 	caddr32_t		kp_public_attributes;
11490Sstevel@tonic-gate 	caddr32_t		kp_private_attributes;
11500Sstevel@tonic-gate 	crypto_mechanism32_t	kp_mechanism;
11510Sstevel@tonic-gate } crypto_object_generate_key_pair32_t;
11520Sstevel@tonic-gate 
11530Sstevel@tonic-gate typedef struct crypto_object_wrap_key32 {
11540Sstevel@tonic-gate 	uint32_t		wk_return_value;
11550Sstevel@tonic-gate 	crypto_session_id_t	wk_session;
11560Sstevel@tonic-gate 	crypto_mechanism32_t	wk_mechanism;
11570Sstevel@tonic-gate 	crypto_key32_t		wk_wrapping_key;
11580Sstevel@tonic-gate 	crypto_object_id_t	wk_object_handle;
11590Sstevel@tonic-gate 	size32_t		wk_wrapped_key_len;
11600Sstevel@tonic-gate 	caddr32_t		wk_wrapped_key;
11610Sstevel@tonic-gate } crypto_object_wrap_key32_t;
11620Sstevel@tonic-gate 
11630Sstevel@tonic-gate typedef struct crypto_object_unwrap_key32 {
11640Sstevel@tonic-gate 	uint32_t		uk_return_value;
11650Sstevel@tonic-gate 	crypto_session_id_t	uk_session;
11660Sstevel@tonic-gate 	crypto_mechanism32_t	uk_mechanism;
11670Sstevel@tonic-gate 	crypto_key32_t		uk_unwrapping_key;
11680Sstevel@tonic-gate 	crypto_object_id_t	uk_object_handle;
11690Sstevel@tonic-gate 	size32_t		uk_wrapped_key_len;
11700Sstevel@tonic-gate 	caddr32_t		uk_wrapped_key;
11710Sstevel@tonic-gate 	uint32_t		uk_count;
11720Sstevel@tonic-gate 	caddr32_t		uk_attributes;
11730Sstevel@tonic-gate } crypto_object_unwrap_key32_t;
11740Sstevel@tonic-gate 
11750Sstevel@tonic-gate typedef struct crypto_derive_key32 {
11760Sstevel@tonic-gate 	uint32_t		dk_return_value;
11770Sstevel@tonic-gate 	crypto_session_id_t	dk_session;
11780Sstevel@tonic-gate 	crypto_mechanism32_t	dk_mechanism;
11790Sstevel@tonic-gate 	crypto_key32_t		dk_base_key;
11800Sstevel@tonic-gate 	crypto_object_id_t	dk_object_handle;
11810Sstevel@tonic-gate 	uint32_t		dk_count;
11820Sstevel@tonic-gate 	caddr32_t		dk_attributes;
11830Sstevel@tonic-gate } crypto_derive_key32_t;
11840Sstevel@tonic-gate 
11850Sstevel@tonic-gate #endif	/* _SYSCALL32 */
11860Sstevel@tonic-gate #endif	/* _KERNEL */
11870Sstevel@tonic-gate 
11880Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY		CRYPTO(110)
11890Sstevel@tonic-gate #define	CRYPTO_GENERATE_KEY_PAIR	CRYPTO(111)
11900Sstevel@tonic-gate #define	CRYPTO_WRAP_KEY			CRYPTO(112)
11910Sstevel@tonic-gate #define	CRYPTO_UNWRAP_KEY		CRYPTO(113)
11920Sstevel@tonic-gate #define	CRYPTO_DERIVE_KEY		CRYPTO(114)
11930Sstevel@tonic-gate 
11940Sstevel@tonic-gate /*
11950Sstevel@tonic-gate  * Provider Management Ioctls
11960Sstevel@tonic-gate  */
11970Sstevel@tonic-gate 
11980Sstevel@tonic-gate typedef struct crypto_get_provider_list {
11990Sstevel@tonic-gate 	uint_t			pl_return_value;
12000Sstevel@tonic-gate 	uint_t			pl_count;
12010Sstevel@tonic-gate 	crypto_provider_entry_t	pl_list[1];
12020Sstevel@tonic-gate } crypto_get_provider_list_t;
12030Sstevel@tonic-gate 
12040Sstevel@tonic-gate typedef struct crypto_provider_data {
12050Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
12060Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
12070Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
12080Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
12090Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
12100Sstevel@tonic-gate 	ulong_t			pd_flags;
12110Sstevel@tonic-gate 	ulong_t			pd_max_session_count;
12120Sstevel@tonic-gate 	ulong_t			pd_session_count;
12130Sstevel@tonic-gate 	ulong_t			pd_max_rw_session_count;
12140Sstevel@tonic-gate 	ulong_t			pd_rw_session_count;
12150Sstevel@tonic-gate 	ulong_t			pd_max_pin_len;
12160Sstevel@tonic-gate 	ulong_t			pd_min_pin_len;
12170Sstevel@tonic-gate 	ulong_t			pd_total_public_memory;
12180Sstevel@tonic-gate 	ulong_t			pd_free_public_memory;
12190Sstevel@tonic-gate 	ulong_t			pd_total_private_memory;
12200Sstevel@tonic-gate 	ulong_t			pd_free_private_memory;
12210Sstevel@tonic-gate 	crypto_version_t	pd_hardware_version;
12220Sstevel@tonic-gate 	crypto_version_t	pd_firmware_version;
12230Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
12240Sstevel@tonic-gate } crypto_provider_data_t;
12250Sstevel@tonic-gate 
12260Sstevel@tonic-gate typedef struct crypto_get_provider_info {
12270Sstevel@tonic-gate 	uint_t			gi_return_value;
12280Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
12290Sstevel@tonic-gate 	crypto_provider_data_t	gi_provider_data;
12300Sstevel@tonic-gate } crypto_get_provider_info_t;
12310Sstevel@tonic-gate 
12320Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms {
12330Sstevel@tonic-gate 	uint_t			pm_return_value;
12340Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
12350Sstevel@tonic-gate 	uint_t			pm_count;
12360Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
12370Sstevel@tonic-gate } crypto_get_provider_mechanisms_t;
12380Sstevel@tonic-gate 
12390Sstevel@tonic-gate typedef struct crypto_get_provider_mechanism_info {
12400Sstevel@tonic-gate 	uint_t			mi_return_value;
12410Sstevel@tonic-gate 	crypto_provider_id_t	mi_provider_id;
12420Sstevel@tonic-gate 	crypto_mech_name_t	mi_mechanism_name;
12430Sstevel@tonic-gate 	uint32_t		mi_min_key_size;
12440Sstevel@tonic-gate 	uint32_t		mi_max_key_size;
12450Sstevel@tonic-gate 	uint32_t		mi_flags;
12460Sstevel@tonic-gate } crypto_get_provider_mechanism_info_t;
12470Sstevel@tonic-gate 
12480Sstevel@tonic-gate typedef struct crypto_init_token {
12490Sstevel@tonic-gate 	uint_t			it_return_value;
12500Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
12510Sstevel@tonic-gate 	caddr_t			it_pin;
12520Sstevel@tonic-gate 	size_t			it_pin_len;
12530Sstevel@tonic-gate 	caddr_t			it_label;
12540Sstevel@tonic-gate } crypto_init_token_t;
12550Sstevel@tonic-gate 
12560Sstevel@tonic-gate typedef struct crypto_init_pin {
12570Sstevel@tonic-gate 	uint_t			ip_return_value;
12580Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
12590Sstevel@tonic-gate 	caddr_t			ip_pin;
12600Sstevel@tonic-gate 	size_t			ip_pin_len;
12610Sstevel@tonic-gate } crypto_init_pin_t;
12620Sstevel@tonic-gate 
12630Sstevel@tonic-gate typedef struct crypto_set_pin {
12640Sstevel@tonic-gate 	uint_t			sp_return_value;
12650Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
12660Sstevel@tonic-gate 	caddr_t			sp_old_pin;
12670Sstevel@tonic-gate 	size_t			sp_old_len;
12680Sstevel@tonic-gate 	caddr_t			sp_new_pin;
12690Sstevel@tonic-gate 	size_t			sp_new_len;
12700Sstevel@tonic-gate } crypto_set_pin_t;
12710Sstevel@tonic-gate 
12720Sstevel@tonic-gate #ifdef	_KERNEL
12730Sstevel@tonic-gate #ifdef	_SYSCALL32
12740Sstevel@tonic-gate 
12750Sstevel@tonic-gate typedef struct crypto_get_provider_list32 {
12760Sstevel@tonic-gate 	uint32_t		pl_return_value;
12770Sstevel@tonic-gate 	uint32_t		pl_count;
12780Sstevel@tonic-gate 	crypto_provider_entry_t pl_list[1];
12790Sstevel@tonic-gate } crypto_get_provider_list32_t;
12800Sstevel@tonic-gate 
12810Sstevel@tonic-gate typedef struct crypto_version32 {
12820Sstevel@tonic-gate 	uchar_t	cv_major;
12830Sstevel@tonic-gate 	uchar_t	cv_minor;
12840Sstevel@tonic-gate } crypto_version32_t;
12850Sstevel@tonic-gate 
12860Sstevel@tonic-gate typedef struct crypto_provider_data32 {
12870Sstevel@tonic-gate 	uchar_t			pd_prov_desc[CRYPTO_PROVIDER_DESCR_MAX_LEN];
12880Sstevel@tonic-gate 	uchar_t			pd_label[CRYPTO_EXT_SIZE_LABEL];
12890Sstevel@tonic-gate 	uchar_t			pd_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
12900Sstevel@tonic-gate 	uchar_t			pd_model[CRYPTO_EXT_SIZE_MODEL];
12910Sstevel@tonic-gate 	uchar_t			pd_serial_number[CRYPTO_EXT_SIZE_SERIAL];
12920Sstevel@tonic-gate 	uint32_t		pd_flags;
12930Sstevel@tonic-gate 	uint32_t		pd_max_session_count;
12940Sstevel@tonic-gate 	uint32_t		pd_session_count;
12950Sstevel@tonic-gate 	uint32_t		pd_max_rw_session_count;
12960Sstevel@tonic-gate 	uint32_t		pd_rw_session_count;
12970Sstevel@tonic-gate 	uint32_t		pd_max_pin_len;
12980Sstevel@tonic-gate 	uint32_t		pd_min_pin_len;
12990Sstevel@tonic-gate 	uint32_t		pd_total_public_memory;
13000Sstevel@tonic-gate 	uint32_t		pd_free_public_memory;
13010Sstevel@tonic-gate 	uint32_t		pd_total_private_memory;
13020Sstevel@tonic-gate 	uint32_t		pd_free_private_memory;
13030Sstevel@tonic-gate 	crypto_version32_t	pd_hardware_version;
13040Sstevel@tonic-gate 	crypto_version32_t	pd_firmware_version;
13050Sstevel@tonic-gate 	uchar_t			pd_time[CRYPTO_EXT_SIZE_TIME];
13060Sstevel@tonic-gate } crypto_provider_data32_t;
13070Sstevel@tonic-gate 
13080Sstevel@tonic-gate typedef struct crypto_get_provider_info32 {
13090Sstevel@tonic-gate 	uint32_t		gi_return_value;
13100Sstevel@tonic-gate 	crypto_provider_id_t	gi_provider_id;
13110Sstevel@tonic-gate 	crypto_provider_data32_t gi_provider_data;
13120Sstevel@tonic-gate } crypto_get_provider_info32_t;
13130Sstevel@tonic-gate 
13140Sstevel@tonic-gate typedef struct crypto_get_provider_mechanisms32 {
13150Sstevel@tonic-gate 	uint32_t		pm_return_value;
13160Sstevel@tonic-gate 	crypto_provider_id_t	pm_provider_id;
13170Sstevel@tonic-gate 	uint32_t		pm_count;
13180Sstevel@tonic-gate 	crypto_mech_name_t	pm_list[1];
13190Sstevel@tonic-gate } crypto_get_provider_mechanisms32_t;
13200Sstevel@tonic-gate 
13210Sstevel@tonic-gate typedef struct crypto_init_token32 {
13220Sstevel@tonic-gate 	uint32_t		it_return_value;
13230Sstevel@tonic-gate 	crypto_provider_id_t	it_provider_id;
13240Sstevel@tonic-gate 	caddr32_t		it_pin;
13250Sstevel@tonic-gate 	size32_t		it_pin_len;
13260Sstevel@tonic-gate 	caddr32_t		it_label;
13270Sstevel@tonic-gate } crypto_init_token32_t;
13280Sstevel@tonic-gate 
13290Sstevel@tonic-gate typedef struct crypto_init_pin32 {
13300Sstevel@tonic-gate 	uint32_t		ip_return_value;
13310Sstevel@tonic-gate 	crypto_session_id_t	ip_session;
13320Sstevel@tonic-gate 	caddr32_t		ip_pin;
13330Sstevel@tonic-gate 	size32_t		ip_pin_len;
13340Sstevel@tonic-gate } crypto_init_pin32_t;
13350Sstevel@tonic-gate 
13360Sstevel@tonic-gate typedef struct crypto_set_pin32 {
13370Sstevel@tonic-gate 	uint32_t		sp_return_value;
13380Sstevel@tonic-gate 	crypto_session_id_t	sp_session;
13390Sstevel@tonic-gate 	caddr32_t		sp_old_pin;
13400Sstevel@tonic-gate 	size32_t		sp_old_len;
13410Sstevel@tonic-gate 	caddr32_t		sp_new_pin;
13420Sstevel@tonic-gate 	size32_t		sp_new_len;
13430Sstevel@tonic-gate } crypto_set_pin32_t;
13440Sstevel@tonic-gate 
13450Sstevel@tonic-gate #endif	/* _SYSCALL32 */
13460Sstevel@tonic-gate #endif	/* _KERNEL */
13470Sstevel@tonic-gate 
13480Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_LIST		CRYPTO(120)
13490Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_INFO		CRYPTO(121)
13500Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISMS		CRYPTO(122)
13510Sstevel@tonic-gate #define	CRYPTO_GET_PROVIDER_MECHANISM_INFO	CRYPTO(123)
13520Sstevel@tonic-gate #define	CRYPTO_INIT_TOKEN			CRYPTO(124)
13530Sstevel@tonic-gate #define	CRYPTO_INIT_PIN				CRYPTO(125)
13540Sstevel@tonic-gate #define	CRYPTO_SET_PIN				CRYPTO(126)
13550Sstevel@tonic-gate 
13564219Smcpowers /*
13574219Smcpowers  * No (Key) Store Key Generation Ioctls
13584219Smcpowers  */
13594219Smcpowers typedef struct crypto_nostore_generate_key {
13604219Smcpowers 	uint_t			ngk_return_value;
13614219Smcpowers 	crypto_session_id_t	ngk_session;
13624219Smcpowers 	crypto_mechanism_t	ngk_mechanism;
13634219Smcpowers 	uint_t			ngk_in_count;
13644219Smcpowers 	uint_t			ngk_out_count;
13654219Smcpowers 	caddr_t			ngk_in_attributes;
13664219Smcpowers 	caddr_t			ngk_out_attributes;
13674219Smcpowers } crypto_nostore_generate_key_t;
13684219Smcpowers 
13694219Smcpowers typedef struct crypto_nostore_generate_key_pair {
13704219Smcpowers 	uint_t			nkp_return_value;
13714219Smcpowers 	crypto_session_id_t	nkp_session;
13724219Smcpowers 	uint_t			nkp_in_public_count;
13734219Smcpowers 	uint_t			nkp_in_private_count;
13744219Smcpowers 	uint_t			nkp_out_public_count;
13754219Smcpowers 	uint_t			nkp_out_private_count;
13764219Smcpowers 	caddr_t			nkp_in_public_attributes;
13774219Smcpowers 	caddr_t			nkp_in_private_attributes;
13784219Smcpowers 	caddr_t			nkp_out_public_attributes;
13794219Smcpowers 	caddr_t			nkp_out_private_attributes;
13804219Smcpowers 	crypto_mechanism_t	nkp_mechanism;
13814219Smcpowers } crypto_nostore_generate_key_pair_t;
13824219Smcpowers 
13834219Smcpowers typedef struct crypto_nostore_derive_key {
13844219Smcpowers 	uint_t			ndk_return_value;
13854219Smcpowers 	crypto_session_id_t	ndk_session;
13864219Smcpowers 	crypto_mechanism_t	ndk_mechanism;
13874219Smcpowers 	crypto_key_t		ndk_base_key;
13884219Smcpowers 	uint_t			ndk_in_count;
13894219Smcpowers 	uint_t			ndk_out_count;
13904219Smcpowers 	caddr_t			ndk_in_attributes;
13914219Smcpowers 	caddr_t			ndk_out_attributes;
13924219Smcpowers } crypto_nostore_derive_key_t;
13934219Smcpowers 
13944219Smcpowers #ifdef	_KERNEL
13954219Smcpowers #ifdef	_SYSCALL32
13964219Smcpowers 
13974219Smcpowers typedef struct crypto_nostore_generate_key32 {
13984219Smcpowers 	uint32_t		ngk_return_value;
13994219Smcpowers 	crypto_session_id_t	ngk_session;
14004219Smcpowers 	crypto_mechanism32_t	ngk_mechanism;
14014219Smcpowers 	uint32_t		ngk_in_count;
14024219Smcpowers 	uint32_t		ngk_out_count;
14034219Smcpowers 	caddr32_t		ngk_in_attributes;
14044219Smcpowers 	caddr32_t		ngk_out_attributes;
14054219Smcpowers } crypto_nostore_generate_key32_t;
14064219Smcpowers 
14074219Smcpowers typedef struct crypto_nostore_generate_key_pair32 {
14084219Smcpowers 	uint32_t		nkp_return_value;
14094219Smcpowers 	crypto_session_id_t	nkp_session;
14104219Smcpowers 	uint32_t		nkp_in_public_count;
14114219Smcpowers 	uint32_t		nkp_in_private_count;
14124219Smcpowers 	uint32_t		nkp_out_public_count;
14134219Smcpowers 	uint32_t		nkp_out_private_count;
14144219Smcpowers 	caddr32_t		nkp_in_public_attributes;
14154219Smcpowers 	caddr32_t		nkp_in_private_attributes;
14164219Smcpowers 	caddr32_t		nkp_out_public_attributes;
14174219Smcpowers 	caddr32_t		nkp_out_private_attributes;
14184219Smcpowers 	crypto_mechanism32_t	nkp_mechanism;
14194219Smcpowers } crypto_nostore_generate_key_pair32_t;
14204219Smcpowers 
14214219Smcpowers #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
14224219Smcpowers #pragma pack(4)
14234219Smcpowers #endif
14244219Smcpowers 
14254219Smcpowers typedef struct crypto_nostore_derive_key32 {
14264219Smcpowers 	uint32_t		ndk_return_value;
14274219Smcpowers 	crypto_session_id_t	ndk_session;
14284219Smcpowers 	crypto_mechanism32_t	ndk_mechanism;
14294219Smcpowers 	crypto_key32_t		ndk_base_key;
14304219Smcpowers 	uint32_t		ndk_in_count;
14314219Smcpowers 	uint32_t		ndk_out_count;
14324219Smcpowers 	caddr32_t		ndk_in_attributes;
14334219Smcpowers 	caddr32_t		ndk_out_attributes;
14344219Smcpowers } crypto_nostore_derive_key32_t;
14354219Smcpowers 
14364219Smcpowers #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
14374219Smcpowers #pragma pack()
14384219Smcpowers #endif
14394219Smcpowers 
14404219Smcpowers #endif	/* _SYSCALL32 */
14414219Smcpowers #endif	/* _KERNEL */
14424219Smcpowers 
14434219Smcpowers #define	CRYPTO_NOSTORE_GENERATE_KEY		CRYPTO(127)
14444219Smcpowers #define	CRYPTO_NOSTORE_GENERATE_KEY_PAIR	CRYPTO(128)
14454219Smcpowers #define	CRYPTO_NOSTORE_DERIVE_KEY		CRYPTO(129)
14464219Smcpowers 
14478313SDina.Nimeh@Sun.Com /*
14488313SDina.Nimeh@Sun.Com  * Mechanism Ioctls
14498313SDina.Nimeh@Sun.Com  */
14508313SDina.Nimeh@Sun.Com 
14518313SDina.Nimeh@Sun.Com typedef struct crypto_get_mechanism_list {
14528313SDina.Nimeh@Sun.Com 	uint_t			ml_return_value;
14538313SDina.Nimeh@Sun.Com 	uint_t			ml_count;
14548313SDina.Nimeh@Sun.Com 	crypto_mech_name_t	ml_list[1];
14558313SDina.Nimeh@Sun.Com } crypto_get_mechanism_list_t;
14568313SDina.Nimeh@Sun.Com 
14578313SDina.Nimeh@Sun.Com typedef struct crypto_get_all_mechanism_info {
14588313SDina.Nimeh@Sun.Com 	uint_t			mi_return_value;
14598313SDina.Nimeh@Sun.Com 	crypto_mech_name_t	mi_mechanism_name;
14608313SDina.Nimeh@Sun.Com 	uint_t			mi_count;
14618313SDina.Nimeh@Sun.Com 	crypto_mechanism_info_t	mi_list[1];
14628313SDina.Nimeh@Sun.Com } crypto_get_all_mechanism_info_t;
14638313SDina.Nimeh@Sun.Com 
14648313SDina.Nimeh@Sun.Com #ifdef	_KERNEL
14658313SDina.Nimeh@Sun.Com #ifdef	_SYSCALL32
14668313SDina.Nimeh@Sun.Com 
14678313SDina.Nimeh@Sun.Com typedef struct crypto_get_mechanism_list32 {
14688313SDina.Nimeh@Sun.Com 	uint32_t		ml_return_value;
14698313SDina.Nimeh@Sun.Com 	uint32_t		ml_count;
14708313SDina.Nimeh@Sun.Com 	crypto_mech_name_t	ml_list[1];
14718313SDina.Nimeh@Sun.Com } crypto_get_mechanism_list32_t;
14728313SDina.Nimeh@Sun.Com 
14738313SDina.Nimeh@Sun.Com typedef struct crypto_get_all_mechanism_info32 {
14748313SDina.Nimeh@Sun.Com 	uint32_t		mi_return_value;
14758313SDina.Nimeh@Sun.Com 	crypto_mech_name_t	mi_mechanism_name;
14768313SDina.Nimeh@Sun.Com 	uint32_t		mi_count;
14778313SDina.Nimeh@Sun.Com 	crypto_mechanism_info32_t mi_list[1];
14788313SDina.Nimeh@Sun.Com } crypto_get_all_mechanism_info32_t;
14798313SDina.Nimeh@Sun.Com 
14808313SDina.Nimeh@Sun.Com #endif	/* _SYSCALL32 */
14818313SDina.Nimeh@Sun.Com #endif	/* _KERNEL */
14828313SDina.Nimeh@Sun.Com 
14838313SDina.Nimeh@Sun.Com #define	CRYPTO_GET_MECHANISM_LIST		CRYPTO(140)
14848313SDina.Nimeh@Sun.Com #define	CRYPTO_GET_ALL_MECHANISM_INFO		CRYPTO(141)
14858313SDina.Nimeh@Sun.Com 
14860Sstevel@tonic-gate #ifdef	__cplusplus
14870Sstevel@tonic-gate }
14880Sstevel@tonic-gate #endif
14890Sstevel@tonic-gate 
14900Sstevel@tonic-gate #endif	/* _SYS_CRYPTO_IOCTL_H */
1491