Skip to content

Commit

Permalink
opencl_sboxes.h: Optimize register pressure for LM hash
Browse files Browse the repository at this point in the history
  • Loading branch information
solardiz committed Oct 21, 2024
1 parent be38677 commit cc89a0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions run/opencl/opencl_lm_kernel_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ typedef unsigned WORD vtype;
#endif

#if defined(_NV) || __CPU__
#define JOHN_DES_OPT_REG /* Optimize register pressure more than gate count */
#include "opencl_sboxes.h"
#else
#include "opencl_sboxes-s.h"
Expand Down
4 changes: 2 additions & 2 deletions run/opencl/opencl_sboxes.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ inline void
s1(vtype a1, vtype a2, vtype a3, vtype a4, vtype a5, vtype a6,
vtype *out, vtype c1, vtype c2, vtype c3, vtype c4)
{
#if 1 /* 23 gates by Sovyn Y. */
#ifndef JOHN_DES_OPT_REG /* 23 gates by Sovyn Y. */
vtype t0 = lut3( a3, a2, a1, 0x29);
vtype t1 = lut3( a6, a5, t0, 0x96);
vtype t2 = lut3( a6, a5, a1, 0x35);
Expand Down Expand Up @@ -151,7 +151,7 @@ inline void
s3(vtype a1, vtype a2, vtype a3, vtype a4, vtype a5, vtype a6,
vtype *out, vtype c1, vtype c2, vtype c3, vtype c4)
{
#if 1 /* 24 gates by Sovyn Y. */
#ifndef JOHN_DES_OPT_REG /* 24 gates by Sovyn Y. */
vtype t0 = lut3( a5, a3, a1, 0x37);
vtype t1 = lut3( a6, a2, t0, 0x96);
vtype t2 = lut3( a6, a5, a4, 0x63);
Expand Down

0 comments on commit cc89a0f

Please sign in to comment.