Print this page
6189743 Need an ARCFOUR implementation optimized for AMD64
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/crypto/common.h
+++ new/usr/src/uts/common/sys/crypto/common.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
↓ open down ↓ |
11 lines elided |
↑ open up ↑ |
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21 /*
22 - * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
22 + * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 26 #ifndef _SYS_CRYPTO_COMMON_H
27 27 #define _SYS_CRYPTO_COMMON_H
28 28
29 -#pragma ident "@(#)common.h 1.24 07/12/10 SMI"
29 +#pragma ident "@(#)common.h 1.25 08/01/02 SMI"
30 30
31 31 /*
32 32 * Header file for the common data structures of the cryptographic framework
33 33 */
34 34
35 35 #ifdef __cplusplus
36 36 extern "C" {
37 37 #endif
38 38
39 39 #include <sys/types.h>
40 40 #include <sys/uio.h>
41 41 #include <sys/stream.h>
42 42 #include <sys/mutex.h>
43 43 #include <sys/condvar.h>
44 44
45 45
46 46 /* Cryptographic Mechanisms */
47 47
48 48 #define CRYPTO_MAX_MECH_NAME 32
49 49 typedef char crypto_mech_name_t[CRYPTO_MAX_MECH_NAME];
50 50
51 51 typedef uint64_t crypto_mech_type_t;
52 52
53 53 typedef struct crypto_mechanism {
54 54 crypto_mech_type_t cm_type; /* mechanism type */
55 55 caddr_t cm_param; /* mech. parameter */
56 56 size_t cm_param_len; /* mech. parameter len */
57 57 } crypto_mechanism_t;
58 58
59 59 #ifdef _SYSCALL32
60 60
61 61 typedef struct crypto_mechanism32 {
62 62 crypto_mech_type_t cm_type; /* mechanism type */
63 63 caddr32_t cm_param; /* mech. parameter */
64 64 size32_t cm_param_len; /* mech. parameter len */
65 65 } crypto_mechanism32_t;
66 66
67 67 #endif /* _SYSCALL32 */
68 68
69 69 /* CK_AES_CTR_PARAMS provides parameters to the CKM_AES_CTR mechanism */
70 70 typedef struct CK_AES_CTR_PARAMS {
71 71 ulong_t ulCounterBits;
72 72 uint8_t cb[16];
73 73 } CK_AES_CTR_PARAMS;
74 74
75 75 /* CK_AES_CCM_PARAMS provides parameters to the CKM_AES_CCM mechanism */
76 76 typedef struct CK_AES_CCM_PARAMS {
77 77 ulong_t ulMACSize;
78 78 ulong_t ulNonceSize;
79 79 ulong_t ulAuthDataSize;
80 80 ulong_t ulDataSize; /* used for plaintext or ciphertext */
81 81 uchar_t *nonce;
82 82 uchar_t *authData;
83 83 } CK_AES_CCM_PARAMS;
84 84
85 85 #ifdef _KERNEL
86 86 /*
87 87 * CK_ECDH1_DERIVE_PARAMS provides the parameters to the
88 88 * CKM_ECDH1_KEY_DERIVE mechanism
89 89 */
90 90 typedef struct CK_ECDH1_DERIVE_PARAMS {
91 91 ulong_t kdf;
92 92 ulong_t ulSharedDataLen;
93 93 uchar_t *pSharedData;
94 94 ulong_t ulPublicDataLen;
95 95 uchar_t *pPublicData;
96 96 } CK_ECDH1_DERIVE_PARAMS;
97 97 #endif
98 98
99 99 #ifdef _KERNEL
100 100 #ifdef _SYSCALL32
101 101
102 102 /* needed for 32-bit applications running on 64-bit kernels */
103 103 typedef struct CK_AES_CTR_PARAMS32 {
104 104 uint32_t ulCounterBits;
105 105 uint8_t cb[16];
106 106 } CK_AES_CTR_PARAMS32;
107 107
108 108 /* needed for 32-bit applications running on 64-bit kernels */
109 109 typedef struct CK_AES_CCM_PARAMS32 {
110 110 uint32_t ulMACSize;
111 111 uint32_t ulNonceSize;
112 112 uint32_t ulAuthDataSize;
113 113 uint32_t ulDataSize;
114 114 caddr32_t nonce;
115 115 caddr32_t authData;
116 116 } CK_AES_CCM_PARAMS32;
117 117
118 118 typedef struct CK_ECDH1_DERIVE_PARAMS32 {
119 119 uint32_t kdf;
120 120 uint32_t ulSharedDataLen;
121 121 caddr32_t pSharedData;
122 122 uint32_t ulPublicDataLen;
123 123 caddr32_t pPublicData;
124 124 } CK_ECDH1_DERIVE_PARAMS32;
125 125
126 126 #endif /* _SYSCALL32 */
127 127 #endif /* _KERNEL */
128 128
129 129 /*
130 130 * The measurement unit bit flag for a mechanism's minimum or maximum key size.
131 131 * The unit are mechanism dependant. It can be in bits or in bytes.
132 132 */
133 133 typedef uint32_t crypto_keysize_unit_t;
134 134
135 135 /*
136 136 * The following bit flags are valid in cm_mech_flags field in
137 137 * the crypto_mech_info_t structure of the SPI.
138 138 *
139 139 * Only the first two bit flags are valid in mi_keysize_unit
140 140 * field in the crypto_mechanism_info_t structure of the API.
141 141 */
142 142 #define CRYPTO_KEYSIZE_UNIT_IN_BITS 0x00000001
143 143 #define CRYPTO_KEYSIZE_UNIT_IN_BYTES 0x00000002
144 144 #define CRYPTO_CAN_SHARE_OPSTATE 0x00000004 /* supports sharing */
145 145
146 146
147 147 /* Mechanisms supported out-of-the-box */
148 148 #define SUN_CKM_MD4 "CKM_MD4"
149 149 #define SUN_CKM_MD5 "CKM_MD5"
150 150 #define SUN_CKM_MD5_HMAC "CKM_MD5_HMAC"
151 151 #define SUN_CKM_MD5_HMAC_GENERAL "CKM_MD5_HMAC_GENERAL"
152 152 #define SUN_CKM_SHA1 "CKM_SHA_1"
153 153 #define SUN_CKM_SHA1_HMAC "CKM_SHA_1_HMAC"
154 154 #define SUN_CKM_SHA1_HMAC_GENERAL "CKM_SHA_1_HMAC_GENERAL"
155 155 #define SUN_CKM_SHA256 "CKM_SHA256"
156 156 #define SUN_CKM_SHA256_HMAC "CKM_SHA256_HMAC"
157 157 #define SUN_CKM_SHA256_HMAC_GENERAL "CKM_SHA256_HMAC_GENERAL"
158 158 #define SUN_CKM_SHA384 "CKM_SHA384"
159 159 #define SUN_CKM_SHA384_HMAC "CKM_SHA384_HMAC"
160 160 #define SUN_CKM_SHA384_HMAC_GENERAL "CKM_SHA384_HMAC_GENERAL"
161 161 #define SUN_CKM_SHA512 "CKM_SHA512"
162 162 #define SUN_CKM_SHA512_HMAC "CKM_SHA512_HMAC"
163 163 #define SUN_CKM_SHA512_HMAC_GENERAL "CKM_SHA512_HMAC_GENERAL"
164 164 #define SUN_CKM_DES_CBC "CKM_DES_CBC"
165 165 #define SUN_CKM_DES3_CBC "CKM_DES3_CBC"
166 166 #define SUN_CKM_DES_ECB "CKM_DES_ECB"
167 167 #define SUN_CKM_DES3_ECB "CKM_DES3_ECB"
168 168 #define SUN_CKM_BLOWFISH_CBC "CKM_BLOWFISH_CBC"
169 169 #define SUN_CKM_BLOWFISH_ECB "CKM_BLOWFISH_ECB"
170 170 #define SUN_CKM_AES_CBC "CKM_AES_CBC"
171 171 #define SUN_CKM_AES_ECB "CKM_AES_ECB"
172 172 #define SUN_CKM_AES_CTR "CKM_AES_CTR"
173 173 #define SUN_CKM_AES_CCM "CKM_AES_CCM"
174 174 #define SUN_CKM_RC4 "CKM_RC4"
175 175 #define SUN_CKM_RSA_PKCS "CKM_RSA_PKCS"
176 176 #define SUN_CKM_RSA_X_509 "CKM_RSA_X_509"
177 177 #define SUN_CKM_MD5_RSA_PKCS "CKM_MD5_RSA_PKCS"
↓ open down ↓ |
138 lines elided |
↑ open up ↑ |
178 178 #define SUN_CKM_SHA1_RSA_PKCS "CKM_SHA1_RSA_PKCS"
179 179 #define SUN_CKM_SHA256_RSA_PKCS "CKM_SHA256_RSA_PKCS"
180 180 #define SUN_CKM_SHA384_RSA_PKCS "CKM_SHA384_RSA_PKCS"
181 181 #define SUN_CKM_SHA512_RSA_PKCS "CKM_SHA512_RSA_PKCS"
182 182 #define SUN_CKM_EC_KEY_PAIR_GEN "CKM_EC_KEY_PAIR_GEN"
183 183 #define SUN_CKM_ECDH1_DERIVE "CKM_ECDH1_DERIVE"
184 184 #define SUN_CKM_ECDSA_SHA1 "CKM_ECDSA_SHA1"
185 185 #define SUN_CKM_ECDSA "CKM_ECDSA"
186 186
187 187 /* Shared operation context format for CKM_RC4 */
188 +#if defined(__amd64)
189 +typedef uint64_t arcfour_key_int_t;
190 +#else
191 +typedef uchar_t arcfour_key_int_t;
192 +#endif /* __amd64 */
193 +
188 194 typedef struct {
189 - uchar_t arr[256];
190 - uchar_t i, j;
195 + arcfour_key_int_t arr[256];
196 + arcfour_key_int_t i, j;
191 197 uint64_t pad; /* For 64-bit alignment */
192 198 } arcfour_state_t;
193 199
194 -
195 200 /* Data arguments of cryptographic operations */
196 201
197 202 typedef enum crypto_data_format {
198 203 CRYPTO_DATA_RAW = 1,
199 204 CRYPTO_DATA_UIO,
200 205 CRYPTO_DATA_MBLK
201 206 } crypto_data_format_t;
202 207
203 208 typedef struct crypto_data {
204 209 crypto_data_format_t cd_format; /* Format identifier */
205 210 off_t cd_offset; /* Offset from the beginning */
206 211 size_t cd_length; /* # of bytes in use */
207 212 caddr_t cd_miscdata; /* ancillary data */
208 213 union {
209 214 /* Raw format */
210 215 iovec_t cdu_raw; /* Pointer and length */
211 216
212 217 /* uio scatter-gather format */
213 218 uio_t *cdu_uio;
214 219
215 220 /* mblk scatter-gather format */
216 221 mblk_t *cdu_mp; /* The mblk chain */
217 222
218 223 } cdu; /* Crypto Data Union */
219 224 } crypto_data_t;
220 225
221 226 #define cd_raw cdu.cdu_raw
222 227 #define cd_uio cdu.cdu_uio
223 228 #define cd_mp cdu.cdu_mp
224 229
225 230 typedef struct crypto_dual_data {
226 231 crypto_data_t dd_data; /* The data */
227 232 off_t dd_offset2; /* Used by dual operation */
228 233 size_t dd_len2; /* # of bytes to take */
229 234 } crypto_dual_data_t;
230 235
231 236 #define dd_format dd_data.cd_format
232 237 #define dd_offset1 dd_data.cd_offset
233 238 #define dd_len1 dd_data.cd_length
234 239 #define dd_miscdata dd_data.cd_miscdata
235 240 #define dd_raw dd_data.cd_raw
236 241 #define dd_uio dd_data.cd_uio
237 242 #define dd_mp dd_data.cd_mp
238 243
239 244 /* The keys, and their contents */
240 245
241 246 typedef enum {
242 247 CRYPTO_KEY_RAW = 1, /* ck_data is a cleartext key */
243 248 CRYPTO_KEY_REFERENCE, /* ck_obj_id is an opaque reference */
244 249 CRYPTO_KEY_ATTR_LIST /* ck_attrs is a list of object attributes */
245 250 } crypto_key_format_t;
246 251
247 252 typedef uint64_t crypto_attr_type_t;
248 253
249 254 /* Attribute types to use for passing a RSA public key or a private key. */
250 255 #define SUN_CKA_MODULUS 0x00000120
251 256 #define SUN_CKA_MODULUS_BITS 0x00000121
252 257 #define SUN_CKA_PUBLIC_EXPONENT 0x00000122
253 258 #define SUN_CKA_PRIVATE_EXPONENT 0x00000123
254 259 #define SUN_CKA_PRIME_1 0x00000124
255 260 #define SUN_CKA_PRIME_2 0x00000125
256 261 #define SUN_CKA_EXPONENT_1 0x00000126
257 262 #define SUN_CKA_EXPONENT_2 0x00000127
258 263 #define SUN_CKA_COEFFICIENT 0x00000128
259 264 #define SUN_CKA_PRIME 0x00000130
260 265 #define SUN_CKA_SUBPRIME 0x00000131
261 266 #define SUN_CKA_BASE 0x00000132
262 267
263 268 #define CKK_EC 0x00000003
264 269 #define CKK_GENERIC_SECRET 0x00000010
265 270 #define CKK_RC4 0x00000012
266 271 #define CKK_AES 0x0000001F
267 272 #define CKK_DES 0x00000013
268 273 #define CKK_DES2 0x00000014
269 274 #define CKK_DES3 0x00000015
270 275
271 276 #define CKO_PUBLIC_KEY 0x00000002
272 277 #define CKO_PRIVATE_KEY 0x00000003
273 278 #define CKA_CLASS 0x00000000
274 279 #define CKA_VALUE 0x00000011
275 280 #define CKA_KEY_TYPE 0x00000100
276 281 #define CKA_VALUE_LEN 0x00000161
277 282 #define CKA_EC_PARAMS 0x00000180
278 283 #define CKA_EC_POINT 0x00000181
279 284
280 285 typedef uint32_t crypto_object_id_t;
281 286
282 287 typedef struct crypto_object_attribute {
283 288 crypto_attr_type_t oa_type; /* attribute type */
284 289 caddr_t oa_value; /* attribute value */
285 290 ssize_t oa_value_len; /* length of attribute value */
286 291 } crypto_object_attribute_t;
287 292
288 293 typedef struct crypto_key {
289 294 crypto_key_format_t ck_format; /* format identifier */
290 295 union {
291 296 /* for CRYPTO_KEY_RAW ck_format */
292 297 struct {
293 298 uint_t cku_v_length; /* # of bits in ck_data */
294 299 void *cku_v_data; /* ptr to key value */
295 300 } cku_key_value;
296 301
297 302 /* for CRYPTO_KEY_REFERENCE ck_format */
298 303 crypto_object_id_t cku_key_id; /* reference to object key */
299 304
300 305 /* for CRYPTO_KEY_ATTR_LIST ck_format */
301 306 struct {
302 307 uint_t cku_a_count; /* number of attributes */
303 308 crypto_object_attribute_t *cku_a_oattr;
304 309 } cku_key_attrs;
305 310 } cku_data; /* Crypto Key union */
306 311 } crypto_key_t;
307 312
308 313 #ifdef _SYSCALL32
309 314
310 315 typedef struct crypto_object_attribute32 {
311 316 uint64_t oa_type; /* attribute type */
312 317 caddr32_t oa_value; /* attribute value */
313 318 ssize32_t oa_value_len; /* length of attribute value */
314 319 } crypto_object_attribute32_t;
315 320
316 321 typedef struct crypto_key32 {
317 322 crypto_key_format_t ck_format; /* format identifier */
318 323 union {
319 324 /* for CRYPTO_KEY_RAW ck_format */
320 325 struct {
321 326 uint32_t cku_v_length; /* # of bytes in ck_data */
322 327 caddr32_t cku_v_data; /* ptr to key value */
323 328 } cku_key_value;
324 329
325 330 /* for CRYPTO_KEY_REFERENCE ck_format */
326 331 crypto_object_id_t cku_key_id; /* reference to object key */
327 332
328 333 /* for CRYPTO_KEY_ATTR_LIST ck_format */
329 334 struct {
330 335 uint32_t cku_a_count; /* number of attributes */
331 336 caddr32_t cku_a_oattr;
332 337 } cku_key_attrs;
333 338 } cku_data; /* Crypto Key union */
334 339 } crypto_key32_t;
335 340
336 341 #endif /* _SYSCALL32 */
337 342
338 343 #define ck_data cku_data.cku_key_value.cku_v_data
339 344 #define ck_length cku_data.cku_key_value.cku_v_length
340 345 #define ck_obj_id cku_data.cku_key_id
341 346 #define ck_count cku_data.cku_key_attrs.cku_a_count
342 347 #define ck_attrs cku_data.cku_key_attrs.cku_a_oattr
343 348
344 349 /*
345 350 * Raw key lengths are expressed in number of bits.
346 351 * The following macro returns the minimum number of
347 352 * bytes that can contain the specified number of bits.
348 353 */
349 354 #define CRYPTO_BITS2BYTES(n) (((n) + 7) >> 3)
350 355
351 356 /* Providers */
352 357
353 358 typedef enum {
354 359 CRYPTO_HW_PROVIDER = 0,
355 360 CRYPTO_SW_PROVIDER,
356 361 CRYPTO_LOGICAL_PROVIDER
357 362 } crypto_provider_type_t;
358 363
359 364 typedef uint32_t crypto_provider_id_t;
360 365 #define KCF_PROVID_INVALID ((uint32_t)-1)
361 366
362 367 typedef struct crypto_provider_entry {
363 368 crypto_provider_id_t pe_provider_id;
364 369 uint_t pe_mechanism_count;
365 370 } crypto_provider_entry_t;
366 371
367 372 typedef struct crypto_dev_list_entry {
368 373 char le_dev_name[MAXNAMELEN];
369 374 uint_t le_dev_instance;
370 375 uint_t le_mechanism_count;
371 376 } crypto_dev_list_entry_t;
372 377
373 378 /* User type for authentication ioctls and SPI entry points */
374 379
375 380 typedef enum crypto_user_type {
376 381 CRYPTO_SO = 0,
377 382 CRYPTO_USER
378 383 } crypto_user_type_t;
379 384
380 385 /* Version for provider management ioctls and SPI entry points */
381 386
382 387 typedef struct crypto_version {
383 388 uchar_t cv_major;
384 389 uchar_t cv_minor;
385 390 } crypto_version_t;
386 391
387 392 /* session data structure opaque to the consumer */
388 393 typedef void *crypto_session_t;
389 394
390 395 /* provider data structure opaque to the consumer */
391 396 typedef void *crypto_provider_t;
392 397
393 398 /* Limits used by both consumers and providers */
394 399 #define CRYPTO_EXT_SIZE_LABEL 32
395 400 #define CRYPTO_EXT_SIZE_MANUF 32
396 401 #define CRYPTO_EXT_SIZE_MODEL 16
397 402 #define CRYPTO_EXT_SIZE_SERIAL 16
398 403 #define CRYPTO_EXT_SIZE_TIME 16
399 404
400 405 typedef struct crypto_provider_ext_info {
401 406 uchar_t ei_label[CRYPTO_EXT_SIZE_LABEL];
402 407 uchar_t ei_manufacturerID[CRYPTO_EXT_SIZE_MANUF];
403 408 uchar_t ei_model[CRYPTO_EXT_SIZE_MODEL];
404 409 uchar_t ei_serial_number[CRYPTO_EXT_SIZE_SERIAL];
405 410 ulong_t ei_flags;
406 411 ulong_t ei_max_session_count;
407 412 ulong_t ei_max_pin_len;
408 413 ulong_t ei_min_pin_len;
409 414 ulong_t ei_total_public_memory;
410 415 ulong_t ei_free_public_memory;
411 416 ulong_t ei_total_private_memory;
412 417 ulong_t ei_free_private_memory;
413 418 crypto_version_t ei_hardware_version;
414 419 crypto_version_t ei_firmware_version;
415 420 uchar_t ei_time[CRYPTO_EXT_SIZE_TIME];
416 421 } crypto_provider_ext_info_t;
417 422
418 423 typedef uint_t crypto_session_id_t;
419 424
420 425 /*
421 426 * Common cryptographic status and error codes.
422 427 */
423 428 #define CRYPTO_SUCCESS 0x00000000
424 429 #define CRYPTO_CANCEL 0x00000001
425 430 #define CRYPTO_HOST_MEMORY 0x00000002
426 431 #define CRYPTO_GENERAL_ERROR 0x00000003
427 432 #define CRYPTO_FAILED 0x00000004
428 433 #define CRYPTO_ARGUMENTS_BAD 0x00000005
429 434 #define CRYPTO_ATTRIBUTE_READ_ONLY 0x00000006
430 435 #define CRYPTO_ATTRIBUTE_SENSITIVE 0x00000007
431 436 #define CRYPTO_ATTRIBUTE_TYPE_INVALID 0x00000008
432 437 #define CRYPTO_ATTRIBUTE_VALUE_INVALID 0x00000009
433 438 #define CRYPTO_CANCELED 0x0000000A
434 439 #define CRYPTO_DATA_INVALID 0x0000000B
435 440 #define CRYPTO_DATA_LEN_RANGE 0x0000000C
436 441 #define CRYPTO_DEVICE_ERROR 0x0000000D
437 442 #define CRYPTO_DEVICE_MEMORY 0x0000000E
438 443 #define CRYPTO_DEVICE_REMOVED 0x0000000F
439 444 #define CRYPTO_ENCRYPTED_DATA_INVALID 0x00000010
440 445 #define CRYPTO_ENCRYPTED_DATA_LEN_RANGE 0x00000011
441 446 #define CRYPTO_KEY_HANDLE_INVALID 0x00000012
442 447 #define CRYPTO_KEY_SIZE_RANGE 0x00000013
443 448 #define CRYPTO_KEY_TYPE_INCONSISTENT 0x00000014
444 449 #define CRYPTO_KEY_NOT_NEEDED 0x00000015
445 450 #define CRYPTO_KEY_CHANGED 0x00000016
446 451 #define CRYPTO_KEY_NEEDED 0x00000017
447 452 #define CRYPTO_KEY_INDIGESTIBLE 0x00000018
448 453 #define CRYPTO_KEY_FUNCTION_NOT_PERMITTED 0x00000019
449 454 #define CRYPTO_KEY_NOT_WRAPPABLE 0x0000001A
450 455 #define CRYPTO_KEY_UNEXTRACTABLE 0x0000001B
451 456 #define CRYPTO_MECHANISM_INVALID 0x0000001C
452 457 #define CRYPTO_MECHANISM_PARAM_INVALID 0x0000001D
453 458 #define CRYPTO_OBJECT_HANDLE_INVALID 0x0000001E
454 459 #define CRYPTO_OPERATION_IS_ACTIVE 0x0000001F
455 460 #define CRYPTO_OPERATION_NOT_INITIALIZED 0x00000020
456 461 #define CRYPTO_PIN_INCORRECT 0x00000021
457 462 #define CRYPTO_PIN_INVALID 0x00000022
458 463 #define CRYPTO_PIN_LEN_RANGE 0x00000023
459 464 #define CRYPTO_PIN_EXPIRED 0x00000024
460 465 #define CRYPTO_PIN_LOCKED 0x00000025
461 466 #define CRYPTO_SESSION_CLOSED 0x00000026
462 467 #define CRYPTO_SESSION_COUNT 0x00000027
463 468 #define CRYPTO_SESSION_HANDLE_INVALID 0x00000028
464 469 #define CRYPTO_SESSION_READ_ONLY 0x00000029
465 470 #define CRYPTO_SESSION_EXISTS 0x0000002A
466 471 #define CRYPTO_SESSION_READ_ONLY_EXISTS 0x0000002B
467 472 #define CRYPTO_SESSION_READ_WRITE_SO_EXISTS 0x0000002C
468 473 #define CRYPTO_SIGNATURE_INVALID 0x0000002D
469 474 #define CRYPTO_SIGNATURE_LEN_RANGE 0x0000002E
470 475 #define CRYPTO_TEMPLATE_INCOMPLETE 0x0000002F
471 476 #define CRYPTO_TEMPLATE_INCONSISTENT 0x00000030
472 477 #define CRYPTO_UNWRAPPING_KEY_HANDLE_INVALID 0x00000031
473 478 #define CRYPTO_UNWRAPPING_KEY_SIZE_RANGE 0x00000032
474 479 #define CRYPTO_UNWRAPPING_KEY_TYPE_INCONSISTENT 0x00000033
475 480 #define CRYPTO_USER_ALREADY_LOGGED_IN 0x00000034
476 481 #define CRYPTO_USER_NOT_LOGGED_IN 0x00000035
477 482 #define CRYPTO_USER_PIN_NOT_INITIALIZED 0x00000036
478 483 #define CRYPTO_USER_TYPE_INVALID 0x00000037
479 484 #define CRYPTO_USER_ANOTHER_ALREADY_LOGGED_IN 0x00000038
480 485 #define CRYPTO_USER_TOO_MANY_TYPES 0x00000039
481 486 #define CRYPTO_WRAPPED_KEY_INVALID 0x0000003A
482 487 #define CRYPTO_WRAPPED_KEY_LEN_RANGE 0x0000003B
483 488 #define CRYPTO_WRAPPING_KEY_HANDLE_INVALID 0x0000003C
484 489 #define CRYPTO_WRAPPING_KEY_SIZE_RANGE 0x0000003D
485 490 #define CRYPTO_WRAPPING_KEY_TYPE_INCONSISTENT 0x0000003E
486 491 #define CRYPTO_RANDOM_SEED_NOT_SUPPORTED 0x0000003F
487 492 #define CRYPTO_RANDOM_NO_RNG 0x00000040
488 493 #define CRYPTO_DOMAIN_PARAMS_INVALID 0x00000041
489 494 #define CRYPTO_BUFFER_TOO_SMALL 0x00000042
490 495 #define CRYPTO_INFORMATION_SENSITIVE 0x00000043
491 496 #define CRYPTO_NOT_SUPPORTED 0x00000044
492 497
493 498 #define CRYPTO_QUEUED 0x00000045
494 499 #define CRYPTO_BUFFER_TOO_BIG 0x00000046
495 500 #define CRYPTO_INVALID_CONTEXT 0x00000047
496 501 #define CRYPTO_INVALID_MAC 0x00000048
497 502 #define CRYPTO_MECH_NOT_SUPPORTED 0x00000049
498 503 #define CRYPTO_INCONSISTENT_ATTRIBUTE 0x0000004A
499 504 #define CRYPTO_NO_PERMISSION 0x0000004B
500 505 #define CRYPTO_INVALID_PROVIDER_ID 0x0000004C
501 506 #define CRYPTO_VERSION_MISMATCH 0x0000004D
502 507 #define CRYPTO_BUSY 0x0000004E
503 508 #define CRYPTO_UNKNOWN_PROVIDER 0x0000004F
504 509 #define CRYPTO_MODVERIFICATION_FAILED 0x00000050
505 510 #define CRYPTO_OLD_CTX_TEMPLATE 0x00000051
506 511 #define CRYPTO_WEAK_KEY 0x00000052
507 512
508 513 /*
509 514 * Special values that can be used to indicate that information is unavailable
510 515 * or that there is not practical limit. These values can be used
511 516 * by fields of the SPI crypto_provider_ext_info(9S) structure.
512 517 * The value of CRYPTO_UNAVAILABLE_INFO should be the same as
513 518 * CK_UNAVAILABLE_INFO in the PKCS#11 spec.
514 519 */
515 520 #define CRYPTO_UNAVAILABLE_INFO ((ulong_t)(-1))
516 521 #define CRYPTO_EFFECTIVELY_INFINITE 0x0
517 522
518 523 #ifdef __cplusplus
519 524 }
520 525 #endif
521 526
522 527 #endif /* _SYS_CRYPTO_COMMON_H */
↓ open down ↓ |
318 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX