Fix UTF8 to UTF16 conversion in -m 1000 -a 3 kernels for non SIMD compute devices

This commit is contained in:
jsteube 2023-02-07 22:24:44 +00:00
parent 1c55ee222c
commit 86f3e1f5b8
1 changed files with 28 additions and 0 deletions

View File

@ -52,6 +52,18 @@ KERNEL_FQ void m01000_mxx (KERN_ATTR_VECTOR ())
w[0] = w0;
#if VECT_SIZE == 1
md4_ctx_t ctx;
md4_init (&ctx);
md4_update_utf16le (&ctx, w, pw_len);
md4_final (&ctx);
#else
md4_ctx_vector_t ctx;
md4_init_vector (&ctx);
@ -60,6 +72,8 @@ KERNEL_FQ void m01000_mxx (KERN_ATTR_VECTOR ())
md4_final_vector (&ctx);
#endif
const u32x r0 = ctx.h[DGST_R0];
const u32x r1 = ctx.h[DGST_R1];
const u32x r2 = ctx.h[DGST_R2];
@ -119,6 +133,18 @@ KERNEL_FQ void m01000_sxx (KERN_ATTR_VECTOR ())
w[0] = w0;
#if VECT_SIZE == 1
md4_ctx_t ctx;
md4_init (&ctx);
md4_update_utf16le (&ctx, w, pw_len);
md4_final (&ctx);
#else
md4_ctx_vector_t ctx;
md4_init_vector (&ctx);
@ -127,6 +153,8 @@ KERNEL_FQ void m01000_sxx (KERN_ATTR_VECTOR ())
md4_final_vector (&ctx);
#endif
const u32x r0 = ctx.h[DGST_R0];
const u32x r1 = ctx.h[DGST_R1];
const u32x r2 = ctx.h[DGST_R2];