Lines Matching defs: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. The _pad variant
94 * Note that all numerics in the key token are big-endian,
95 * while the entries in the key block header are little-endian.
98 * @p: pointer to memory area for the key
100 * Returns the size of the key area or negative errno value.
115 } __packed *key = p;
128 memset(key, 0, sizeof(*key));
130 key->pubHdr = static_pub_hdr;
131 key->pubSec = static_pub_sec;
133 /* key parameter block */
134 temp = key->exponent;
149 key->pubSec.modulus_bit_len = 8 * mex->inputdatalength;
150 key->pubSec.modulus_byte_len = mex->inputdatalength;
151 key->pubSec.exponent_len = mex->inputdatalength - i;
152 key->pubSec.section_length = sizeof(key->pubSec) +
154 key->pubHdr.token_length =
155 key->pubSec.section_length + sizeof(key->pubHdr);
156 key->t6_hdr.ulen = key->pubHdr.token_length + 4;
157 key->t6_hdr.blen = key->pubHdr.token_length + 6;
158 return sizeof(*key) + 2*mex->inputdatalength - i;
162 * Set up private key fields of a type6 CRT message.
163 * Note that all numerics in the key token are big-endian,
164 * while the entries in the key block header are little-endian.
167 * @p: pointer to memory area for the key
169 * Returns the size of the key area or -EFAULT
184 } __packed *key = p;
197 memset(key, 0, sizeof(*key));
203 size = sizeof(*key) + key_len + sizeof(*pub) + 3;
205 /* parameter block.key block */
206 key->t6_hdr.blen = size;
207 key->t6_hdr.ulen = size - 2;
209 /* key token header */
210 key->token.token_identifier = CCA_TKN_HDR_ID_EXT;
211 key->token.token_length = size - 6;
214 key->pvt.section_identifier = CCA_PVT_EXT_CRT_SEC_ID_PVT;
215 key->pvt.section_length = sizeof(key->pvt) + key_len;
216 key->pvt.key_format = CCA_PVT_EXT_CRT_SEC_FMT_CL;
217 key->pvt.key_use_flags[0] = CCA_PVT_USAGE_ALL;
218 key->pvt.p_len = key->pvt.dp_len = key->pvt.u_len = long_len;
219 key->pvt.q_len = key->pvt.dq_len = short_len;
220 key->pvt.mod_len = crt->inputdatalength;
221 key->pvt.pad_len = pad_len;
223 /* key parts */
224 if (copy_from_user(key->key_parts, crt->np_prime, long_len) ||
225 copy_from_user(key->key_parts + long_len,
227 copy_from_user(key->key_parts + long_len + short_len,
229 copy_from_user(key->key_parts + 2*long_len + short_len,
231 copy_from_user(key->key_parts + 2*long_len + 2*short_len,
234 memset(key->key_parts + 3*long_len + 2*short_len + pad_len,
236 pub = (struct cca_public_sec *)(key->key_parts + key_len);
240 * In a private key, the modulus doesn't appear in the public