From 69725b929b386308fc4b403169b278051e699759 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 14 Jan 2021 12:01:31 +0100 Subject: [PATCH] Add 5opencl to regression tests --- tools/hitag2crack/crack5opencl/ht2crack5opencl.c | 6 +++--- tools/pm3_tests.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/tools/hitag2crack/crack5opencl/ht2crack5opencl.c b/tools/hitag2crack/crack5opencl/ht2crack5opencl.c index c1994c153..bdff13ffc 100644 --- a/tools/hitag2crack/crack5opencl/ht2crack5opencl.c +++ b/tools/hitag2crack/crack5opencl/ht2crack5opencl.c @@ -1547,10 +1547,10 @@ int main(int argc, char **argv) { struct timeval cpu_t_start, cpu_t_end, cpu_t_result; - fprintf(stderr, "Attack 5 - opencl - start (Max Slices %u, %s order", max_step, wu_queue_strdesc(ctx.queue_ctx.queue_type)); + printf("Attack 5 - opencl - start (Max Slices %u, %s order", max_step, wu_queue_strdesc(ctx.queue_ctx.queue_type)); - if (!verbose) fprintf(stderr, ")\n\n"); - else fprintf(stderr, ", Profile %d, Async Threads %s, HiTag2 key verify on device %s)\n\n", profile, (ctx.thread_sched_type == THREAD_TYPE_ASYNC) ? "yes" : "no", (force_hitag2_opencl) ? "yes" : "no"); + if (!verbose) printf(")\n\n"); + else printf(", Profile %d, Async Threads %s, HiTag2 key verify on device %s)\n\n", profile, (ctx.thread_sched_type == THREAD_TYPE_ASYNC) ? "yes" : "no", (force_hitag2_opencl) ? "yes" : "no"); if (gettimeofday(&cpu_t_start, NULL) == -1) { printf("! gettimeofday(start) failed (%d): %s\n", errno, strerror(errno)); diff --git a/tools/pm3_tests.sh b/tools/pm3_tests.sh index 36b2a3494..3c59949ee 100755 --- a/tools/pm3_tests.sh +++ b/tools/pm3_tests.sh @@ -318,6 +318,15 @@ while true; do HT2CRACK5GPUNRAR="B438220C 944FFD74 942C59E3 3D450B34" # Order of magnitude to crack it: ~15s -> tagged as "slow" if ! CheckExecute slow gpu "ht2crack5gpu test" "cd $HT2CRACK5GPUPATH; ./ht2crack5gpu $HT2CRACK5GPUUID $HT2CRACK5GPUNRAR" "Key: $HT2CRACK5GPUKEY"; then break; fi + + echo -e "\n${C_BLUE}Testing ht2crack5opencl:${C_NC} ${HT2CRACK5OPENCLPATH:=./tools/hitag2crack/crack5opencl/}" + if ! CheckFileExist "ht2crack5opencl exists" "$HT2CRACK5OPENCLPATH/ht2crack5opencl"; then break; fi + HT2CRACK5OPENCLUID=12345678 + HT2CRACK5OPENCLKEY=AABBCCDDEEFF + # The speed depends on the nRaR so we'll use two pairs known to work fast + HT2CRACK5OPENCLNRAR="B438220C 944FFD74 942C59E3 3D450B34" + # Order of magnitude to crack it: ~15s -> tagged as "slow" + if ! CheckExecute slow gpu "ht2crack5opencl test" "cd $HT2CRACK5OPENCLPATH; ./ht2crack5opencl $HT2CRACK5OPENCLUID $HT2CRACK5OPENCLNRAR" "Key found.*: $HT2CRACK5OPENCLKEY"; then break; fi fi if $TESTALL || $TESTCLIENT; then echo -e "\n${C_BLUE}Testing client:${C_NC} ${CLIENTBIN:=./client/proxmark3}"