--- Crypt-Twofish2/twofish.c 2021/08/01 12:32:06 1.3 +++ Crypt-Twofish2/twofish.c 2021/08/01 18:09:47 1.4 @@ -135,7 +135,8 @@ #define Fe32_(x,R) (_sBox_[0][2*_b(x,R )] ^ _sBox_[0][2*_b(x,R+1)+1] ^ \ _sBox_[2][2*_b(x,R+2)] ^ _sBox_[2][2*_b(x,R+3)+1]) /* set a single S-box value, given the input byte */ -#define sbSet(N,i,J,v) { _sBox_[N&2][2*i+(N&1)+2*J]=MDStab[N][v]; } +//#define sbSet(N,i,J,v) { _sBox_[N&2][2*i+(N&1)+2*J]=MDStab[N][v]; } +#define sbSet(N,i,J,v) { *((DWORD *)_sBox_ + (N&2)*256 + 2*i + (N&1) + 2*J) = MDStab[N][v]; } #define GetSboxKey #endif