/* Name of the zcrypt device driver. */ #define ZCRYPT_NAME "zcrypt"
/** * struct ica_rsa_modexpo * * Requirements: * - outputdatalength is at least as large as inputdatalength. * - All key parts are right justified in their fields, padded on * the left with zeroes. * - length(b_key) = inputdatalength * - length(n_modulus) = inputdatalength
*/ struct ica_rsa_modexpo {
__u8 __user *inputdata;
__u32 inputdatalength;
__u8 __user *outputdata;
__u32 outputdatalength;
__u8 __user *b_key;
__u8 __user *n_modulus;
};
/** * struct ica_rsa_modexpo_crt * * Requirements: * - inputdatalength is even. * - outputdatalength is at least as large as inputdatalength. * - All key parts are right justified in their fields, padded on * the left with zeroes. * - length(bp_key) = inputdatalength/2 + 8 * - length(bq_key) = inputdatalength/2 * - length(np_key) = inputdatalength/2 + 8 * - length(nq_key) = inputdatalength/2 * - length(u_mult_inv) = inputdatalength/2 + 8
*/ struct ica_rsa_modexpo_crt {
__u8 __user *inputdata;
__u32 inputdatalength;
__u8 __user *outputdata;
__u32 outputdatalength;
__u8 __user *bp_key;
__u8 __user *bq_key;
__u8 __user *np_prime;
__u8 __user *nq_prime;
__u8 __user *u_mult_inv;
};
/** * CPRBX * Note that all shorts and ints are big-endian. * All pointer fields are 16 bytes long, and mean nothing. * * A request CPRB is followed by a request_parameter_block. * * The request (or reply) parameter block is organized thus: * function code * VUD block * key block
*/ struct CPRBX {
__u16 cprb_len; /* CPRB length 220 */
__u8 cprb_ver_id; /* CPRB version id. 0x02 */
__u8 ctfm; /* Command Type Filtering Mask */
__u8 pad_000[2]; /* Alignment pad bytes */
__u8 func_id[2]; /* function id 0x5432 */
__u8 cprb_flags[4]; /* Flags */
__u32 req_parml; /* request parameter buffer len */
__u32 req_datal; /* request data buffer */
__u32 rpl_msgbl; /* reply message block length */
__u32 rpld_parml; /* replied parameter block len */
__u32 rpl_datal; /* reply data block len */
__u32 rpld_datal; /* replied data block len */
__u32 req_extbl; /* request extension block len */
__u8 _pad_001[4]; /* reserved */
__u32 rpld_extbl; /* replied extension block len */
__u8 _pad_002[16 - sizeof(__u8 *)];
__u8 __user *req_parmb; /* request parm block 'address' */
__u8 _pad_003[16 - sizeof(__u8 *)];
__u8 __user *req_datab; /* request data block 'address' */
__u8 _pad_004[16 - sizeof(__u8 *)];
__u8 __user *rpl_parmb; /* reply parm block 'address' */
__u8 _pad_005[16 - sizeof(__u8 *)];
__u8 __user *rpl_datab; /* reply data block 'address' */
__u8 _pad_006[16 - sizeof(__u8 *)];
__u8 __user *req_extb; /* request extension block 'addr'*/
__u8 _pad_007[16 - sizeof(__u8 *)];
__u8 __user *rpl_extb; /* reply extension block 'address'*/
__u16 ccp_rtcode; /* server return code */
__u16 ccp_rscode; /* server reason code */
__u32 mac_data_len; /* Mac Data Length */
__u8 logon_id[8]; /* Logon Identifier */
__u8 mac_value[8]; /* Mac Value */
__u8 mac_content_flgs; /* Mac content flag byte */
__u8 _pad_008; /* Alignment */
__u16 domain; /* Domain */
__u8 _pad_009[12]; /* reserved, checked for zeros */
__u8 _pad_010[36]; /* reserved */
} __attribute__((packed));
/** * struct ep11_target_dev - EP11 target device list * @ap_id: AP device id * @dom_id: Usage domain id
*/ struct ep11_target_dev {
__u16 ap_id;
__u16 dom_id;
};
/** * struct ep11_urb - EP11 user request block * @targets_num: Number of target adapters * @targets: Addr to target adapter list * @weight: Level of request priority * @req_no: Request id/number * @req_len: Request length * @req: Addr to request block * @resp_len: Response length * @resp: Addr to response block
*/ struct ep11_urb {
__u16 targets_num;
__u8 __user *targets;
__u64 weight;
__u64 req_no;
__u64 req_len;
__u8 __user *req;
__u64 resp_len;
__u8 __user *resp;
} __attribute__((packed));
/** * struct zcrypt_device_status_ext * @hwtype: raw hardware type * @qid: 8 bit device index, 8 bit domain * @functions: AP device function bit field 'abcdef' * a, b, c = reserved * d = CCA coprocessor * e = Accelerator * f = EP11 coprocessor * @online online status * @reserved reserved
*/ struct zcrypt_device_status_ext { unsignedint hwtype:8; unsignedint qid:16; unsignedint online:1; unsignedint functions:6; unsignedint reserved:1;
};
/** * Interface notes: * * The ioctl()s which are implemented (along with relevant details) * are: * * ICARSAMODEXPO * Perform an RSA operation using a Modulus-Exponent pair * This takes an ica_rsa_modexpo struct as its arg. * * NOTE: please refer to the comments preceding this structure * for the implementation details for the contents of the * block * * ICARSACRT * Perform an RSA operation using a Chinese-Remainder Theorem key * This takes an ica_rsa_modexpo_crt struct as its arg. * * NOTE: please refer to the comments preceding this structure * for the implementation details for the contents of the * block * * ZSECSENDCPRB * Send an arbitrary CPRB to a crypto card. * * ZSENDEP11CPRB * Send an arbitrary EP11 CPRB to an EP11 coprocessor crypto card. * * ZCRYPT_DEVICE_STATUS * The given struct zcrypt_device_matrix_ext is updated with * status information for each currently known apqn. * * ZCRYPT_STATUS_MASK * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned chars for the * status of all devices. * 0x01: PCICA * 0x02: PCICC * 0x03: PCIXCC_MCL2 * 0x04: PCIXCC_MCL3 * 0x05: CEX2C * 0x06: CEX2A * 0x07: CEX3C * 0x08: CEX3A * 0x0a: CEX4 * 0x0b: CEX5 * 0x0c: CEX6, CEX7 or CEX8 * 0x0d: device is disabled * * ZCRYPT_QDEPTH_MASK * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned chars for the * queue depth of all devices. * * ZCRYPT_PERDEV_REQCNT * Return an MAX_ZDEV_CARDIDS_EXT element array of unsigned integers for * the number of successfully completed requests per device since the * device was detected and made available. *
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.