From 5475e882a76c060115c5900acea0e0f172a866c5 Mon Sep 17 00:00:00 2001 From: bacqube2 Date: Wed, 8 Feb 2023 12:57:17 +0100 Subject: [PATCH] Ajout de printf pour tracer l'execution des fonctions --- OpenCL/inc_hash_blake2s.cl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/OpenCL/inc_hash_blake2s.cl b/OpenCL/inc_hash_blake2s.cl index d3a87272a..c47e123a1 100644 --- a/OpenCL/inc_hash_blake2s.cl +++ b/OpenCL/inc_hash_blake2s.cl @@ -136,6 +136,7 @@ DECLSPEC u32x blake2s_rot08 (const u32x a) DECLSPEC void blake2s_transform (PRIVATE_AS u32 *h, PRIVATE_AS const u32 *m, const int len, const u32 f0) { + printf("transform\n"); // printf("------\nm : %x\n", m[0]); const u32 t0 = len; @@ -196,6 +197,7 @@ DECLSPEC void blake2s_transform (PRIVATE_AS u32 *h, PRIVATE_AS const u32 *m, con DECLSPEC void blake2s_init (PRIVATE_AS blake2s_ctx_t *ctx) { + printf("Init\n"); ctx->h[0] = BLAKE2S_IV_00 ^ 0x01010020; // default output length: 0x20 = 32 bytes ctx->h[1] = BLAKE2S_IV_01; ctx->h[2] = BLAKE2S_IV_02; @@ -227,6 +229,7 @@ DECLSPEC void blake2s_init (PRIVATE_AS blake2s_ctx_t *ctx) DECLSPEC void blake2s_update_64 (PRIVATE_AS blake2s_ctx_t *ctx, PRIVATE_AS u32 *w0, PRIVATE_AS u32 *w1, PRIVATE_AS u32 *w2, PRIVATE_AS u32 *w3, const int len) { + printf("update_64\n"); if (len == 0) return; const int pos = ctx->len & 63; @@ -334,6 +337,7 @@ DECLSPEC void blake2s_update_64 (PRIVATE_AS blake2s_ctx_t *ctx, PRIVATE_AS u32 * DECLSPEC void blake2s_update (PRIVATE_AS blake2s_ctx_t *ctx, PRIVATE_AS const u32 *w, const int len) { + printf("update\n"); u32 w0[4]; u32 w1[4]; u32 w2[4]; @@ -388,6 +392,7 @@ DECLSPEC void blake2s_update (PRIVATE_AS blake2s_ctx_t *ctx, PRIVATE_AS const u3 DECLSPEC void blake2s_update_global (PRIVATE_AS blake2s_ctx_t *ctx, GLOBAL_AS const u32 *w, const int len) { + printf("update_global\n"); u32 w0[4]; u32 w1[4]; u32 w2[4]; @@ -442,11 +447,13 @@ DECLSPEC void blake2s_update_global (PRIVATE_AS blake2s_ctx_t *ctx, GLOBAL_AS co DECLSPEC void blake2s_final (PRIVATE_AS blake2s_ctx_t *ctx) { + printf("final\n"); blake2s_transform (ctx->h, ctx->m, ctx->len, BLAKE2S_FINAL); } DECLSPEC void blake2s_transform_vector (PRIVATE_AS u32x *h, PRIVATE_AS const u32x *m, const u32x len, const u32 f0) { + printf("transform_vector\n"); const u32x t0 = len; u32x v[16]; @@ -493,6 +500,8 @@ DECLSPEC void blake2s_transform_vector (PRIVATE_AS u32x *h, PRIVATE_AS const u32 DECLSPEC void blake2s_init_vector (PRIVATE_AS blake2s_ctx_vector_t *ctx) { + printf("init_vector\n"); + ctx->h[0] = BLAKE2S_IV_00 ^ 0x01010020; // default output length: 0x20 = 32 bytes ctx->h[1] = BLAKE2S_IV_01; ctx->h[2] = BLAKE2S_IV_02; @@ -524,6 +533,9 @@ DECLSPEC void blake2s_init_vector (PRIVATE_AS blake2s_ctx_vector_t *ctx) DECLSPEC void blake2s_init_vector_from_scalar (PRIVATE_AS blake2s_ctx_vector_t *ctx, PRIVATE_AS blake2s_ctx_t *ctx0) { + + printf("init_vector_scalar\n"); + ctx->h[0] = ctx0->h[0]; ctx->h[1] = ctx0->h[1]; ctx->h[2] = ctx0->h[2]; @@ -555,6 +567,9 @@ DECLSPEC void blake2s_init_vector_from_scalar (PRIVATE_AS blake2s_ctx_vector_t * DECLSPEC void blake2s_update_vector_64 (PRIVATE_AS blake2s_ctx_vector_t *ctx, PRIVATE_AS u32x *w0, PRIVATE_AS u32x *w1, PRIVATE_AS u32x *w2, PRIVATE_AS u32x *w3, const int len) { + + printf("update_vector_64\n"); + if (len == 0) return; const int pos = ctx->len & 63; @@ -662,6 +677,9 @@ DECLSPEC void blake2s_update_vector_64 (PRIVATE_AS blake2s_ctx_vector_t *ctx, PR DECLSPEC void blake2s_update_vector (PRIVATE_AS blake2s_ctx_vector_t *ctx, PRIVATE_AS const u32x *w, const int len) { + + printf("update_vector\n"); + u32x w0[4]; u32x w1[4]; u32x w2[4]; @@ -716,5 +734,8 @@ DECLSPEC void blake2s_update_vector (PRIVATE_AS blake2s_ctx_vector_t *ctx, PRIVA DECLSPEC void blake2s_final_vector (PRIVATE_AS blake2s_ctx_vector_t *ctx) { + + printf("final_vector\n"); + blake2s_transform_vector (ctx->h, ctx->m, (u32x) ctx->len, BLAKE2S_FINAL); }