Lines Matching refs:op

82 	crypto_op_t *op = malloc(sizeof (*op));  in cryptotest_init()  local
84 if (op == NULL) { in cryptotest_init()
93 free(op); in cryptotest_init()
98 op->in = (char *)arg->in; in cryptotest_init()
99 op->out = (char *)arg->out; in cryptotest_init()
100 op->key = (char *)arg->key; in cryptotest_init()
101 op->param = (char *)arg->param; in cryptotest_init()
103 op->inlen = arg->inlen; in cryptotest_init()
104 op->outlen = arg->outlen; in cryptotest_init()
105 op->keylen = arg->keylen * 8; /* kcf uses keylen in bits */ in cryptotest_init()
106 op->paramlen = arg->plen; in cryptotest_init()
107 op->updatelens = arg->updatelens; in cryptotest_init()
109 op->mechname = arg->mechname; in cryptotest_init()
111 op->hsession = CRYPTO_INVALID_SESSION; in cryptotest_init()
112 op->fg = fg; in cryptotest_init()
114 if (op->out == NULL) in cryptotest_init()
115 op->outlen = op->inlen; in cryptotest_init()
116 return (op); in cryptotest_init()
129 cryptotest_close(crypto_op_t *op) in cryptotest_close() argument
131 if (op->hsession != CRYPTO_INVALID_SESSION) in cryptotest_close()
132 (void) cryptotest_close_session(op->hsession); in cryptotest_close()
133 free(op); in cryptotest_close()
140 get_mech_info(crypto_op_t *op) in get_mech_info() argument
146 get_number.pn_mechanism_string = op->mechname; in get_mech_info()
147 get_number.pn_mechanism_len = strlen(op->mechname) + 1; in get_mech_info()
152 op->mechname); in get_mech_info()
155 op->mech = get_number.pn_internal_number; in get_mech_info()
160 get_hsession_by_mech(crypto_op_t *op) in get_hsession_by_mech() argument
165 mech.mech_keylen = op->keylen; in get_hsession_by_mech()
166 mech.mech_type = op->mech; in get_hsession_by_mech()
167 mech.mech_fg = op->fg; in get_hsession_by_mech()
179 op->hsession = mech.session_id; in get_hsession_by_mech()
188 mac_init(crypto_op_t *op) in mac_init() argument
194 init.mi_session = op->hsession; in mac_init()
196 init.mi_key.ck_data = op->key; in mac_init()
198 init.mi_key.ck_length = op->keylen; in mac_init()
200 init.mi_mech.cm_type = op->mech; in mac_init()
208 mac_single(crypto_op_t *op) in mac_single() argument
213 mac.cm_session = op->hsession; in mac_single()
214 mac.cm_datalen = op->inlen; in mac_single()
215 mac.cm_databuf = op->in; in mac_single()
216 mac.cm_maclen = op->outlen; in mac_single()
217 mac.cm_macbuf = op->out; in mac_single()
223 mac_update(crypto_op_t *op, size_t offset, size_t len, size_t *dummy __unused) in mac_update() argument
229 update.mu_session = op->hsession; in mac_update()
230 update.mu_databuf = op->in + offset; in mac_update()
237 mac_final(crypto_op_t *op, size_t dummy __unused) in mac_final() argument
243 final.mf_session = op->hsession; in mac_final()
244 final.mf_maclen = op->outlen; in mac_final()
245 final.mf_macbuf = op->out; in mac_final()
256 encrypt_init(crypto_op_t *op) in encrypt_init() argument
262 init.ei_session = op->hsession; in encrypt_init()
264 init.ei_key.ck_data = op->key; in encrypt_init()
266 init.ei_key.ck_length = op->keylen; in encrypt_init()
268 init.ei_mech.cm_type = op->mech; in encrypt_init()
269 init.ei_mech.cm_param = op->param; in encrypt_init()
270 init.ei_mech.cm_param_len = op->paramlen; in encrypt_init()
276 encrypt_single(crypto_op_t *op) in encrypt_single() argument
281 encrypt.ce_session = op->hsession; in encrypt_single()
282 encrypt.ce_datalen = op->inlen; in encrypt_single()
283 encrypt.ce_databuf = op->in; in encrypt_single()
284 encrypt.ce_encrlen = op->outlen; in encrypt_single()
285 encrypt.ce_encrbuf = op->out; in encrypt_single()
291 encrypt_update(crypto_op_t *op, size_t offset, size_t plainlen, size_t *encrlen) in encrypt_update() argument
297 update.eu_session = op->hsession; in encrypt_update()
298 update.eu_databuf = op->in + offset; in encrypt_update()
300 update.eu_encrlen = op->outlen - *encrlen; in encrypt_update()
301 update.eu_encrbuf = op->out + *encrlen; in encrypt_update()
309 encrypt_final(crypto_op_t *op, size_t encrlen) in encrypt_final() argument
315 final.ef_session = op->hsession; in encrypt_final()
316 final.ef_encrlen = op->outlen - encrlen; in encrypt_final()
317 final.ef_encrbuf = op->out + encrlen; in encrypt_final()
327 decrypt_init(crypto_op_t *op) in decrypt_init() argument
333 init.di_session = op->hsession; in decrypt_init()
335 init.di_key.ck_data = op->key; in decrypt_init()
337 init.di_key.ck_length = op->keylen; in decrypt_init()
339 init.di_mech.cm_type = op->mech; in decrypt_init()
340 init.di_mech.cm_param = op->param; in decrypt_init()
341 init.di_mech.cm_param_len = op->paramlen; in decrypt_init()
347 decrypt_single(crypto_op_t *op) in decrypt_single() argument
352 decrypt.cd_session = op->hsession; in decrypt_single()
353 decrypt.cd_datalen = op->outlen; in decrypt_single()
354 decrypt.cd_databuf = op->out; in decrypt_single()
355 decrypt.cd_encrlen = op->inlen; in decrypt_single()
356 decrypt.cd_encrbuf = op->in; in decrypt_single()
362 decrypt_update(crypto_op_t *op, size_t offset, size_t len, size_t *encrlen) in decrypt_update() argument
369 update.du_session = op->hsession; in decrypt_update()
370 update.du_databuf = op->out + *encrlen; in decrypt_update()
371 update.du_datalen = op->outlen - *encrlen; in decrypt_update()
373 update.du_encrbuf = op->in + offset; in decrypt_update()
381 decrypt_final(crypto_op_t *op, size_t encrlen) in decrypt_final() argument
387 final.df_session = op->hsession; in decrypt_final()
388 final.df_datalen = op->outlen - encrlen; in decrypt_final()
389 final.df_databuf = op->out + encrlen; in decrypt_final()
395 digest_init(crypto_op_t *op) in digest_init() argument
401 init.di_session = op->hsession; in digest_init()
403 init.di_mech.cm_type = op->mech; in digest_init()
411 digest_single(crypto_op_t *op) in digest_single() argument
417 digest.cd_session = op->hsession; in digest_single()
419 digest.cd_datalen = op->inlen; in digest_single()
420 digest.cd_databuf = op->in; in digest_single()
421 digest.cd_digestlen = op->outlen; in digest_single()
422 digest.cd_digestbuf = op->out; in digest_single()
428 digest_update(crypto_op_t *op, size_t offset, size_t len, in digest_update() argument
435 update.du_session = op->hsession; in digest_update()
438 update.du_databuf = op->in + offset; in digest_update()
445 digest_final(crypto_op_t *op, size_t dummy __unused) in digest_final() argument
451 final.df_session = op->hsession; in digest_final()
453 final.df_digestlen = op->outlen; in digest_final()
454 final.df_digestbuf = op->out; in digest_final()