Lines Matching refs:key

21  * mapping for the cca private ME key token.
25 * mapping for the cca key token header
40 * In a private key, the modulus doesn't appear in the public
51 unsigned short modulus_byte_len; /* In a private key, this is 0 */
55 * mapping for the cca private CRT key 'token'
92 * Set up private key fields of a type6 MEX message.
95 * @p: pointer to memory area for the key
97 * Returns the size of the key area or negative errno value.
112 } __packed *key = p;
124 memset(key, 0, sizeof(*key));
126 key->pubhdr = static_pub_hdr;
127 key->pubsec = static_pub_sec;
129 /* key parameter block */
130 ptr = key->exponent;
138 key->pubsec.modulus_bit_len = 8 * mex->inputdatalength;
139 key->pubsec.modulus_byte_len = mex->inputdatalength;
140 key->pubsec.exponent_len = mex->inputdatalength;
141 key->pubsec.section_length = sizeof(key->pubsec) +
143 key->pubhdr.token_length =
144 key->pubsec.section_length + sizeof(key->pubhdr);
145 key->t6_hdr.ulen = key->pubhdr.token_length + 4;
146 key->t6_hdr.blen = key->pubhdr.token_length + 6;
148 return sizeof(*key) + 2 * mex->inputdatalength;
152 * Set up private key fields of a type6 CRT message.
155 * @p: pointer to memory area for the key
157 * Returns the size of the key area or -EFAULT
172 } __packed *key = p;
185 memset(key, 0, sizeof(*key));
191 size = sizeof(*key) + key_len + sizeof(*pub) + 3;
193 /* parameter block.key block */
194 key->t6_hdr.blen = size;
195 key->t6_hdr.ulen = size - 2;
197 /* key token header */
198 key->token.token_identifier = CCA_TKN_HDR_ID_EXT;
199 key->token.token_length = size - 6;
202 key->pvt.section_identifier = CCA_PVT_EXT_CRT_SEC_ID_PVT;
203 key->pvt.section_length = sizeof(key->pvt) + key_len;
204 key->pvt.key_format = CCA_PVT_EXT_CRT_SEC_FMT_CL;
205 key->pvt.key_use_flags[0] = CCA_PVT_USAGE_ALL;
206 key->pvt.p_len = key->pvt.dp_len = key->pvt.u_len = long_len;
207 key->pvt.q_len = key->pvt.dq_len = short_len;
208 key->pvt.mod_len = crt->inputdatalength;
209 key->pvt.pad_len = pad_len;
211 /* key parts */
212 if (copy_from_user(key->key_parts, crt->np_prime, long_len) ||
213 copy_from_user(key->key_parts + long_len,
215 copy_from_user(key->key_parts + long_len + short_len,
217 copy_from_user(key->key_parts + 2 * long_len + short_len,
219 copy_from_user(key->key_parts + 2 * long_len + 2 * short_len,
222 memset(key->key_parts + 3 * long_len + 2 * short_len + pad_len,
224 pub = (struct cca_public_sec *)(key->key_parts + key_len);
228 * In a private key, the modulus doesn't appear in the public