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