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