26 #ifndef _ZCRYPT_CCA_KEY_H_
27 #define _ZCRYPT_CCA_KEY_H_
49 #define CCA_TKN_HDR_ID_EXT 0x1E
71 #define CCA_PVT_USAGE_ALL 0x80
123 #define CCA_PVT_EXT_CRT_SEC_ID_PVT 0x08
124 #define CCA_PVT_EXT_CRT_SEC_FMT_CL 0x40
137 void *
p,
int big_endian)
141 .token_length = 0x0183,
145 .section_length = 0x016C,
146 .key_use_flags = {0x80,0x00,0x00,0x00},
150 .section_length = 0x000F,
151 .exponent_len = 0x0003,
153 static char pk_exponent[3] = { 0x01, 0x00, 0x01 };
172 key->pvtMeHdr = static_pvt_me_hdr;
173 key->pvtMeSec = static_pvt_me_sec;
174 key->pubMeSec = static_pub_me_sec;
183 temp =
key->pvtMeSec.exponent +
189 temp =
key->pvtMeSec.modulus +
209 void *
p,
int big_endian)
228 key->pubHdr = static_pub_hdr;
229 key->pubSec = static_pub_sec;
232 temp =
key->exponent;
250 key->pubSec.section_length =
sizeof(
key->pubSec) +
252 key->pubHdr.token_length =
253 key->pubSec.section_length +
sizeof(
key->pubHdr);
275 void *p,
int big_endian)
279 .section_length = 0x000f,
280 .exponent_len = 0x0003,
282 static char pk_exponent[3] = { 0x01, 0x00, 0x01 };
295 long_len = short_len + 8;
296 pad_len = -(3*long_len + 2*short_len) & 7;
298 size =
sizeof(*key) + key_len +
sizeof(*pub) + 3;
311 key->token.token_length = size - 6;
315 key->pvt.section_length =
sizeof(
key->pvt) + key_len;
318 key->pvt.p_len =
key->pvt.dp_len =
key->pvt.u_len = long_len;
319 key->pvt.q_len =
key->pvt.dq_len = short_len;
330 crt->
bq_key, short_len) ||
334 memset(
key->key_parts + 3*long_len + 2*short_len + pad_len,
337 *pub = static_cca_pub_sec;
344 memcpy((
char *) (pub + 1), pk_exponent, 3);