• Home
  • Raw
  • Download

Lines Matching refs:tc

369 static int create_pad_descriptor(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **pad_des…  in create_pad_descriptor()  argument
390 switch (tc->unit_no) { in create_pad_descriptor()
392 error = create_md5_pad(alloc_flag, tc->consumed, &pad, &plen); in create_pad_descriptor()
399 mo.hashconf = tc->hash_conf; in create_pad_descriptor()
400 mo.hashmode = tc->hash_mode; in create_pad_descriptor()
403 error = create_sha1_pad(alloc_flag, tc->consumed, &pad, &plen); in create_pad_descriptor()
410 mo.hashconf = tc->hash_conf; in create_pad_descriptor()
411 mo.hashmode = tc->hash_mode; in create_pad_descriptor()
414 if (tc->consumed % tc->blocklength){ in create_pad_descriptor()
440 static int setup_key_dl_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **kd, int all… in setup_key_dl_desc() argument
453 if ((tc->tctx->init.alg == cryptocop_alg_aes) && (tc->tcfg->flags & CRYPTOCOP_DECRYPT)) { in setup_key_dl_desc()
455 if (!tc->tctx->dec_key_set){ in setup_key_dl_desc()
456 get_aes_decrypt_key(tc->tctx->dec_key, tc->tctx->init.key, tc->tctx->init.keylen); in setup_key_dl_desc()
457 tc->tctx->dec_key_set = 1; in setup_key_dl_desc()
459 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->dec_key); in setup_key_dl_desc()
460 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8; in setup_key_dl_desc()
462 key_desc->dma_descr->buf = (char*)virt_to_phys(tc->tctx->init.key); in setup_key_dl_desc()
463 key_desc->dma_descr->after = key_desc->dma_descr->buf + tc->tctx->init.keylen/8; in setup_key_dl_desc()
467 switch (tc->tctx->init.keylen) { in setup_key_dl_desc()
498 static int setup_cipher_iv_desc(struct cryptocop_tfrm_ctx *tc, struct cryptocop_dma_desc **id, int … in setup_cipher_iv_desc() argument
510 iv_desc->dma_descr->buf = (char*)virt_to_phys(tc->tcfg->iv); in setup_cipher_iv_desc()
511 iv_desc->dma_descr->after = iv_desc->dma_descr->buf + tc->blocklength; in setup_cipher_iv_desc()
516 mo.ciphconf = tc->ciph_conf; in setup_cipher_iv_desc()
517 mo.cbcmode = tc->cbcmode; in setup_cipher_iv_desc()
530 …criptors(struct cryptocop_operation *operation, struct cryptocop_tfrm_ctx *tc, struct cryptocop_dm… in create_input_descriptors() argument
540 size_t out_length = tc->produced; in create_input_descriptors()
545 …if (((tc->produced + tc->tcfg->inject_ix) > operation->tfrm_op.outlen) || (tc->produced && (operat… in create_input_descriptors()
550 …op.outcount) && ((out_ix + operation->tfrm_op.outdata[outiov_ix].iov_len) <= tc->tcfg->inject_ix)){ in create_input_descriptors()
558 iov_offset = tc->tcfg->inject_ix - out_ix; in create_input_descriptors()
559 mi.dmasel = tc->unit_no; in create_input_descriptors()
652 …desc, struct cryptocop_dma_desc **current_out_cdesc, struct cryptocop_tfrm_ctx *tc, int alloc_flag) in append_input_descriptors() argument
654 DEBUG(printk("append_input_descriptors, tc=0x%p, unit_no=%d\n", tc, tc->unit_no)); in append_input_descriptors()
655 if (tc->tcfg) { in append_input_descriptors()
658 …input_descriptors: pushing output, consumed %d produced %d bytes.\n", tc->consumed, tc->produced)); in append_input_descriptors()
659 if (tc->pad_descs) { in append_input_descriptors()
661 while (tc->pad_descs) { in append_input_descriptors()
662 DEBUG(printk("append descriptor 0x%p\n", tc->pad_descs)); in append_input_descriptors()
663 (*current_out_cdesc)->next = tc->pad_descs; in append_input_descriptors()
664 tc->pad_descs = tc->pad_descs->next; in append_input_descriptors()
670 if (tc->unit_no == src_dma){ in append_input_descriptors()
673 unsigned int start_ix = tc->start_ix; in append_input_descriptors()
691 failed = create_input_descriptors(operation, tc, &idescs, alloc_flag); in append_input_descriptors()
996 struct cryptocop_tfrm_ctx *tc = NULL; in cryptocop_setup_dma_list() local
1001 tc = &digest_ctx; in cryptocop_setup_dma_list()
1003 tc = &cipher_ctx; in cryptocop_setup_dma_list()
1005 tc = &csum_ctx; in cryptocop_setup_dma_list()
1007 if (!tc) { in cryptocop_setup_dma_list()
1012 if (tc->done) { in cryptocop_setup_dma_list()
1017 if (!tc->active) { in cryptocop_setup_dma_list()
1018 tc->start_ix = indata_ix; in cryptocop_setup_dma_list()
1019 tc->active = 1; in cryptocop_setup_dma_list()
1022 tc->previous_src = tc->current_src; in cryptocop_setup_dma_list()
1023 tc->prev_src = tc->curr_src; in cryptocop_setup_dma_list()
1027 tc->current_src = src_dma; in cryptocop_setup_dma_list()
1030 tc->current_src = src_des; in cryptocop_setup_dma_list()
1033 tc->current_src = src_des; in cryptocop_setup_dma_list()
1036 tc->current_src = src_aes; in cryptocop_setup_dma_list()
1049 if (tc->current_src != src_dma) { in cryptocop_setup_dma_list()
1051 if (digest_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1052 tc->curr_src = &digest_ctx; in cryptocop_setup_dma_list()
1053 } else if (cipher_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1054 tc->curr_src = &cipher_ctx; in cryptocop_setup_dma_list()
1055 } else if (csum_ctx.unit_no == tc->current_src){ in cryptocop_setup_dma_list()
1056 tc->curr_src = &csum_ctx; in cryptocop_setup_dma_list()
1058 if ((tc->curr_src == tc) && (tc->unit_no != src_dma)){ in cryptocop_setup_dma_list()
1059 …DEBUG_API(printk("cryptocop_setup_dma_list: unit %d configured to source from itself.\n", tc->unit… in cryptocop_setup_dma_list()
1064 tc->curr_src = NULL; in cryptocop_setup_dma_list()
1068 …>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()
1069 if (tc->active && (tc->current_src != tc->previous_src)) { in cryptocop_setup_dma_list()
1074 if (((tc->prev_src != NULL) && (tc->prev_src->consumed % tc->prev_src->blocklength)) || in cryptocop_setup_dma_list()
1075 ((tc->curr_src != NULL) && (tc->curr_src->consumed % tc->curr_src->blocklength))) in cryptocop_setup_dma_list()
1077tc->prev_src ? tc->prev_src->consumed : INT_MIN, tc->prev_src ? tc->prev_src->produced : INT_MIN, in cryptocop_setup_dma_list()
1085 tc->done = 1; in cryptocop_setup_dma_list()
1581 struct cryptocop_transform_ctx *tc; in cryptocop_free_session() local
1634 tc = sess->tfrm_ctx; in cryptocop_free_session()
1636 while (tc){ in cryptocop_free_session()
1637 DEBUG(printk("cryptocop_free_session: memset keys, tfrm id=%d\n", tc->init.tid)); in cryptocop_free_session()
1638 memset(tc->init.key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH); in cryptocop_free_session()
1639 memset(tc->dec_key, 0xff, CRYPTOCOP_MAX_KEY_LENGTH); in cryptocop_free_session()
1640 tc = tc->next; in cryptocop_free_session()
1665 struct cryptocop_transform_ctx *tc = sess->tfrm_ctx; in get_transform_ctx() local
1669 while (tc && tc->init.tid != tid){ in get_transform_ctx()
1670 DEBUG(printk("tc=0x%p, tc->next=0x%p\n", tc, tc->next)); in get_transform_ctx()
1671 tc = tc->next; in get_transform_ctx()
1673 DEBUG(printk("get_transform_ctx, returning tc=0x%p\n", tc)); in get_transform_ctx()
1674 return tc; in get_transform_ctx()
2592 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_CIPHER_TID); in cryptocop_ioctl_process() local
2593 if (!tc) { in cryptocop_ioctl_process()
2607 cblocklen = tc->init.alg == cryptocop_alg_aes ? AES_BLOCK_LENGTH : DES_BLOCK_LENGTH; in cryptocop_ioctl_process()
2615 if (tc->init.cipher_mode == cryptocop_cipher_mode_cbc){ in cryptocop_ioctl_process()
2646 struct cryptocop_transform_ctx *tc = get_transform_ctx(sess, CRYPTOCOP_IOCTL_DIGEST_TID); in cryptocop_ioctl_process() local
2647 if (!tc) { in cryptocop_ioctl_process()
2652 digest_length = tc->init.alg == cryptocop_alg_md5 ? 16 : 20; in cryptocop_ioctl_process()
3279 struct cryptocop_tfrm_cfg *tc; in print_cryptocop_operation() local
3315 tc = cop->tfrm_op.tfrm_cfg; in print_cryptocop_operation()
3316 while (tc){ in print_cryptocop_operation()
3322 tc, in print_cryptocop_operation()
3323 tc->tid, in print_cryptocop_operation()
3324 tc->flags, in print_cryptocop_operation()
3325 tc->inject_ix, in print_cryptocop_operation()
3326 tc->next); in print_cryptocop_operation()
3327 tc = tc->next; in print_cryptocop_operation()