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