Lines Matching refs:key
112 } __packed *key = p; in zcrypt_type6_mex_key_en() local
124 memset(key, 0, sizeof(*key)); in zcrypt_type6_mex_key_en()
126 key->pubhdr = static_pub_hdr; in zcrypt_type6_mex_key_en()
127 key->pubsec = static_pub_sec; in zcrypt_type6_mex_key_en()
130 ptr = key->exponent; in zcrypt_type6_mex_key_en()
138 key->pubsec.modulus_bit_len = 8 * mex->inputdatalength; in zcrypt_type6_mex_key_en()
139 key->pubsec.modulus_byte_len = mex->inputdatalength; in zcrypt_type6_mex_key_en()
140 key->pubsec.exponent_len = mex->inputdatalength; in zcrypt_type6_mex_key_en()
141 key->pubsec.section_length = sizeof(key->pubsec) + in zcrypt_type6_mex_key_en()
143 key->pubhdr.token_length = in zcrypt_type6_mex_key_en()
144 key->pubsec.section_length + sizeof(key->pubhdr); in zcrypt_type6_mex_key_en()
145 key->t6_hdr.ulen = key->pubhdr.token_length + 4; in zcrypt_type6_mex_key_en()
146 key->t6_hdr.blen = key->pubhdr.token_length + 6; in zcrypt_type6_mex_key_en()
148 return sizeof(*key) + 2 * mex->inputdatalength; in zcrypt_type6_mex_key_en()
172 } __packed *key = p; in zcrypt_type6_crt_key() local
185 memset(key, 0, sizeof(*key)); in zcrypt_type6_crt_key()
191 size = sizeof(*key) + key_len + sizeof(*pub) + 3; in zcrypt_type6_crt_key()
194 key->t6_hdr.blen = size; in zcrypt_type6_crt_key()
195 key->t6_hdr.ulen = size - 2; in zcrypt_type6_crt_key()
198 key->token.token_identifier = CCA_TKN_HDR_ID_EXT; in zcrypt_type6_crt_key()
199 key->token.token_length = size - 6; in zcrypt_type6_crt_key()
202 key->pvt.section_identifier = CCA_PVT_EXT_CRT_SEC_ID_PVT; in zcrypt_type6_crt_key()
203 key->pvt.section_length = sizeof(key->pvt) + key_len; in zcrypt_type6_crt_key()
204 key->pvt.key_format = CCA_PVT_EXT_CRT_SEC_FMT_CL; in zcrypt_type6_crt_key()
205 key->pvt.key_use_flags[0] = CCA_PVT_USAGE_ALL; in zcrypt_type6_crt_key()
206 key->pvt.p_len = key->pvt.dp_len = key->pvt.u_len = long_len; in zcrypt_type6_crt_key()
207 key->pvt.q_len = key->pvt.dq_len = short_len; in zcrypt_type6_crt_key()
208 key->pvt.mod_len = crt->inputdatalength; in zcrypt_type6_crt_key()
209 key->pvt.pad_len = pad_len; in zcrypt_type6_crt_key()
212 if (copy_from_user(key->key_parts, crt->np_prime, long_len) || in zcrypt_type6_crt_key()
213 copy_from_user(key->key_parts + long_len, in zcrypt_type6_crt_key()
215 copy_from_user(key->key_parts + long_len + short_len, in zcrypt_type6_crt_key()
217 copy_from_user(key->key_parts + 2 * long_len + short_len, in zcrypt_type6_crt_key()
219 copy_from_user(key->key_parts + 2 * long_len + 2 * short_len, in zcrypt_type6_crt_key()
222 memset(key->key_parts + 3 * long_len + 2 * short_len + pad_len, in zcrypt_type6_crt_key()
224 pub = (struct cca_public_sec *)(key->key_parts + key_len); in zcrypt_type6_crt_key()