Lines Matching refs:tc
368 static int create_pad_descriptor(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **pad_des… in create_pad_descriptor() argument
389 switch (tc->unit_no) { in create_pad_descriptor()
391 error = create_md5_pad(alloc_flag, tc->consumed, &pad, &plen); in create_pad_descriptor()
398 mo.hashconf = tc->hash_conf; in create_pad_descriptor()
399 mo.hashmode = tc->hash_mode; in create_pad_descriptor()
402 error = create_sha1_pad(alloc_flag, tc->consumed, &pad, &plen); in create_pad_descriptor()
409 mo.hashconf = tc->hash_conf; in create_pad_descriptor()
410 mo.hashmode = tc->hash_mode; in create_pad_descriptor()
413 if (tc->consumed % tc->blocklength){ in create_pad_descriptor()
439 static int setup_key_dl_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **kd, int all… in setup_key_dl_desc() argument
452 if ((tc->tctx->init.alg == cryptocop_alg_aes) && (tc->tcfg->flags & CRYPTOCOP_DECRYPT)) { in setup_key_dl_desc()
454 if (!tc->tctx->dec_key_set){ in setup_key_dl_desc()
455 get_aes_decrypt_key(tc->tctx->dec_key, tc->tctx->init.key, tc->tctx->init.keylen); in setup_key_dl_desc()
456 tc->tctx->dec_key_set = 1; in setup_key_dl_desc()
458 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->dec_key); in setup_key_dl_desc()
459 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8; in setup_key_dl_desc()
461 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->init.key); in setup_key_dl_desc()
462 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8; in setup_key_dl_desc()
466 switch (tc->tctx->init.keylen) { in setup_key_dl_desc()
497 static int setup_cipher_iv_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **id, int … in setup_cipher_iv_desc() argument
509 iv_desc->dma_descr->buf = (char*)virt_to_phys(tc->tcfg->iv); in setup_cipher_iv_desc()
510 iv_desc->dma_descr->after = iv_desc->dma_descr->buf + tc->blocklength; in setup_cipher_iv_desc()
515 mo.ciphconf = tc->ciph_conf; in setup_cipher_iv_desc()
516 mo.cbcmode = tc->cbcmode; in setup_cipher_iv_desc()
529 …criptors(struct cryptocop_operation *operation, struct cryptocop_tfrm_ctx *tc, struct cryptocop_dm… in create_input_descriptors() argument
539 size_t out_length = tc->produced; in create_input_descriptors()
544 …if (((tc->produced + tc->tcfg->inject_ix) > operation->tfrm_op.outlen) || (tc->produced && (operat… in create_input_descriptors()
549 …op.outcount) && ((out_ix + operation->tfrm_op.outdata[outiov_ix].iov_len) <= tc->tcfg->inject_ix)){ in create_input_descriptors()
557 iov_offset = tc->tcfg->inject_ix - out_ix; in create_input_descriptors()
558 mi.dmasel = tc->unit_no; in create_input_descriptors()
651 …desc, struct cryptocop_dma_desc **current_out_cdesc, struct cryptocop_tfrm_ctx *tc, int alloc_flag) in append_input_descriptors() argument
653 DEBUG(printk("append_input_descriptors, tc=0x%p, unit_no=%d\n", tc, tc->unit_no)); in append_input_descriptors()
654 if (tc->tcfg) { in append_input_descriptors()
657 …input_descriptors: pushing output, consumed %d produced %d bytes.\n", tc->consumed, tc->produced)); in append_input_descriptors()
658 if (tc->pad_descs) { in append_input_descriptors()
660 while (tc->pad_descs) { in append_input_descriptors()
661 DEBUG(printk("append descriptor 0x%p\n", tc->pad_descs)); in append_input_descriptors()
662 (*current_out_cdesc)->next = tc->pad_descs; in append_input_descriptors()
663 tc->pad_descs = tc->pad_descs->next; in append_input_descriptors()
669 if (tc->unit_no == src_dma){ in append_input_descriptors()
672 unsigned int start_ix = tc->start_ix; in append_input_descriptors()
690 failed = create_input_descriptors(operation, tc, &idescs, alloc_flag); in append_input_descriptors()
995 struct cryptocop_tfrm_ctx *tc = NULL; in cryptocop_setup_dma_list() local
1000 tc = &digest_ctx; in cryptocop_setup_dma_list()
1002 tc = &cipher_ctx; in cryptocop_setup_dma_list()
1004 tc = &csum_ctx; in cryptocop_setup_dma_list()
1006 if (!tc) { in cryptocop_setup_dma_list()
1011 if (tc->done) { in cryptocop_setup_dma_list()
1016 if (!tc->active) { in cryptocop_setup_dma_list()
1017 tc->start_ix = indata_ix; in cryptocop_setup_dma_list()
1018 tc->active = 1; in cryptocop_setup_dma_list()
1021 tc->previous_src = tc->current_src; in cryptocop_setup_dma_list()
1022 tc->prev_src = tc->curr_src; in cryptocop_setup_dma_list()
1026 tc->current_src = src_dma; in cryptocop_setup_dma_list()
1029 tc->current_src = src_des; in cryptocop_setup_dma_list()
1032 tc->current_src = src_des; in cryptocop_setup_dma_list()
1035 tc->current_src = src_aes; in cryptocop_setup_dma_list()
1048 if (tc->current_src != src_dma) { in cryptocop_setup_dma_list()
1050 if (digest_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1051 tc->curr_src = &digest_ctx; in cryptocop_setup_dma_list()
1052 } else if (cipher_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1053 tc->curr_src = &cipher_ctx; in cryptocop_setup_dma_list()
1054 } else if (csum_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1055 tc->curr_src = &csum_ctx; in cryptocop_setup_dma_list()
1057 if ((tc->curr_src == tc) && (tc->unit_no != src_dma)){ in cryptocop_setup_dma_list()
1058 …DEBUG_API(printk("cryptocop_setup_dma_list: unit %d configured to source from itself.\n", tc->unit… in cryptocop_setup_dma_list()
1063 tc->curr_src = NULL; in cryptocop_setup_dma_list()
1067 …>curr_src=0x%p, tc->prev_srv=0x%p\n", tc->active, tc->unit_no, tc->current_src, tc->previous_src, … in cryptocop_setup_dma_list()
1068 if (tc->active && (tc->current_src != tc->previous_src)) { in cryptocop_setup_dma_list()
1073 if (((tc->prev_src != NULL) && (tc->prev_src->consumed % tc->prev_src->blocklength)) || in cryptocop_setup_dma_list()
1074 ((tc->curr_src != NULL) && (tc->curr_src->consumed % tc->curr_src->blocklength))) in cryptocop_setup_dma_list()
1076 …tc->prev_src ? tc->prev_src->consumed : INT_MIN, tc->prev_src ? tc->prev_src->produced : INT_MIN, … in cryptocop_setup_dma_list()
1084 tc->done = 1; in cryptocop_setup_dma_list()
1582 struct cryptocop_transform_ctx *tc; in cryptocop_free_session() local
1635 tc = sess->tfrm_ctx; in cryptocop_free_session()
1637 while (tc){ in cryptocop_free_session()
1638 DEBUG(printk("cryptocop_free_session: memset keys, tfrm id=%d\n", tc->init.tid)); in cryptocop_free_session()
1639 memset(tc->init.key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH); in cryptocop_free_session()
1640 memset(tc->dec_key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH); in cryptocop_free_session()
1641 tc = tc->next; in cryptocop_free_session()
1666 struct cryptocop_transform_ctx *tc = sess->tfrm_ctx; in get_transform_ctx() local
1670 while (tc && tc->init.tid != tid){ in get_transform_ctx()
1671 DEBUG(printk("tc=0x%p, tc->next=0x%p\n", tc, tc->next)); in get_transform_ctx()
1672 tc = tc->next; in get_transform_ctx()
1674 DEBUG(printk("get_transform_ctx, returning tc=0x%p\n", tc)); in get_transform_ctx()
1675 return tc; in get_transform_ctx()
2593 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_CIPHER_TID); in cryptocop_ioctl_process() local
2594 if (!tc) { in cryptocop_ioctl_process()
2608 cblocklen = tc->init.alg == cryptocop_alg_aes ? AES_BLOCK_LENGTH : DES_BLOCK_LENGTH; in cryptocop_ioctl_process()
2616 if (tc->init.cipher_mode == cryptocop_cipher_mode_cbc){ in cryptocop_ioctl_process()
2647 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_DIGEST_TID); in cryptocop_ioctl_process() local
2648 if (!tc) { in cryptocop_ioctl_process()
2653 digest_length = tc->init.alg == cryptocop_alg_md5 ? 16 : 20; in cryptocop_ioctl_process()
3287 struct cryptocop_tfrm_cfg *tc; in print_cryptocop_operation() local
3323 tc = cop->tfrm_op.tfrm_cfg; in print_cryptocop_operation()
3324 while (tc){ in print_cryptocop_operation()
3330 tc, in print_cryptocop_operation()
3331 tc->tid, in print_cryptocop_operation()
3332 tc->flags, in print_cryptocop_operation()
3333 tc->inject_ix, in print_cryptocop_operation()
3334 tc->next); in print_cryptocop_operation()
3335 tc = tc->next; in print_cryptocop_operation()