[GH-ISSUE #266] Keccak code breaks on hardware better than SSE2. #26

Closed
opened 2026-10-14 02:50:03 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @magnumripper on GitHub (Apr 17, 2013).
Original GitHub issue: https://github.com/openwall/john/issues/266

SSE2 build works fine here and on Bull. But AVX or XOP (or -native) builds fail after a wad of warnings. This also means GPU builds fail on most modern hardware since they also use -march=native.

This might be easy but I'm not sure where to start.

First couple of warnings for AVX:

KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP"
     #error "UseBebigokimisa cannot be used in combination with UseXOP"
      ^
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords':
KeccakF-1600-opt64_plug.c:187:5: warning: implicit declaration of function '_mm_roti_epi64' [-Wimplicit-function-declaration]
     rounds
     ^
KeccakF-1600-opt64_plug.c:187:5: error: incompatible type for argument 2 of '_mm_xor_si128'
In file included from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/xmmintrin.h:1246:0,
                 from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/x86intrin.h:34,
                 from KeccakF-1600-opt64_plug.c:76:
/usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/emmintrin.h:1248:1: note: expected '__m128i' but argument is of type 'int'
 _mm_xor_si128 (__m128i __A, __m128i __B)
 ^

and for XOP:

KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP"
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords':
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dio' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dua' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Ama' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Aku' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Amae' [-Wunused-variable]
KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWordsAfterXoring':
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dio' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dua' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Ama' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Aku' [-Wunused-variable]
KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Amae' [-Wunused-variable]

As a workaround until we get it straight, we could add some #undef __SSSE3__, #undef __XOP__ and so on in some of the headers for keccak.

Originally created by @magnumripper on GitHub (Apr 17, 2013). Original GitHub issue: https://github.com/openwall/john/issues/266 SSE2 build works fine here and on Bull. But AVX or XOP (or -native) builds fail after a wad of warnings. This also means GPU builds fail on most modern hardware since they also use -march=native. This might be easy but I'm not sure where to start. First couple of warnings for AVX: ``` KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP" #error "UseBebigokimisa cannot be used in combination with UseXOP" ^ KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords': KeccakF-1600-opt64_plug.c:187:5: warning: implicit declaration of function '_mm_roti_epi64' [-Wimplicit-function-declaration] rounds ^ KeccakF-1600-opt64_plug.c:187:5: error: incompatible type for argument 2 of '_mm_xor_si128' In file included from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/xmmintrin.h:1246:0, from /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/x86intrin.h:34, from KeccakF-1600-opt64_plug.c:76: /usr/local/Cellar/gcc48/4.8.0/gcc/lib/gcc/x86_64-apple-darwin12.3.0/4.8.0/include/emmintrin.h:1248:1: note: expected '__m128i' but argument is of type 'int' _mm_xor_si128 (__m128i __A, __m128i __B) ^ ``` and for XOP: ``` KeccakF-1600-opt64_plug.c:135:6: error: #error "UseBebigokimisa cannot be used in combination with UseXOP" KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWords': KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dio' [-Wunused-variable] KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Dua' [-Wunused-variable] KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Ama' [-Wunused-variable] KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Aku' [-Wunused-variable] KeccakF-1600-opt64_plug.c:181:5: warning: unused variable 'Amae' [-Wunused-variable] KeccakF-1600-opt64_plug.c: In function 'KeccakPermutationOnWordsAfterXoring': KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dio' [-Wunused-variable] KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Dua' [-Wunused-variable] KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Ama' [-Wunused-variable] KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Aku' [-Wunused-variable] KeccakF-1600-opt64_plug.c:195:5: warning: unused variable 'Amae' [-Wunused-variable] ``` As a workaround until we get it straight, we could add some `#undef __SSSE3__`, `#undef __XOP__` and so on in some of the headers for keccak.
Author
Owner

@magnumripper commented on GitHub (Apr 18, 2013):

1fd965b seems to make it buildable on all systems. But there are tons of warnings we'd like to mute, and AVX doesn't seem to run optimal code (it's slower than SSE2).

<!-- gh-comment-id:16566389 --> @magnumripper commented on GitHub (Apr 18, 2013): 1fd965b seems to make it buildable on all systems. But there are tons of warnings we'd like to mute, and AVX doesn't seem to run optimal code (it's slower than SSE2).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#26
No description provided.