From 9c2c73c6ccbdd8e1b22fc78255851a807fe845d4 Mon Sep 17 00:00:00 2001 From: Jens Steube Date: Fri, 15 Nov 2019 10:12:33 +0100 Subject: [PATCH] Clear hook buffers after full kernel chain is finished --- src/backend.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/backend.c b/src/backend.c index 177597943..f29d77723 100644 --- a/src/backend.c +++ b/src/backend.c @@ -3102,6 +3102,34 @@ int choose_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, if (run_kernel (hashcat_ctx, device_param, KERN_RUN_3, pws_cnt, false, 0) == -1) return -1; } } + + /* + * maybe we should add this zero of temporary buffers + * however it drops the performance from 7055338 to 7010621 + + if (device_param->is_cuda == true) + { + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_tmps, device_param->size_tmps) == -1) return -1; + } + + if (device_param->is_opencl == true) + { + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_tmps, device_param->size_tmps) == -1) return -1; + } + */ + + if ((hashconfig->opts_type & OPTS_TYPE_HOOK12) || (hashconfig->opts_type & OPTS_TYPE_HOOK23)) + { + if (device_param->is_cuda == true) + { + if (run_cuda_kernel_bzero (hashcat_ctx, device_param, device_param->cuda_d_hooks, device_param->size_hooks) == -1) return -1; + } + + if (device_param->is_opencl == true) + { + if (run_opencl_kernel_bzero (hashcat_ctx, device_param, device_param->opencl_d_hooks, device_param->size_hooks) == -1) return -1; + } + } } return 0;