aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-05-23 14:38:26 +1200
committerDavid Phillips <david@sighup.nz>2017-05-23 14:38:26 +1200
commit5b2aa52f06dbf3d5aed7165b1b9fe5ca1cf38af4 (patch)
tree5950068ee507813cb66b8d712760479aa82f3db9
parent4995b5fe9a01a10b2487bd73bb214a4584bc4c1c (diff)
parent42dd9aef074243833b4318e725ec2f9786c9acc1 (diff)
downloadsand-leek-5b2aa52f06dbf3d5aed7165b1b9fe5ca1cf38af4.tar.xz
Merge branch 'ssse3-default'
-rw-r--r--Makefile2
-rw-r--r--onion_base32.c4
-rw-r--r--onion_base32.h2
-rw-r--r--sand-leek.c8
4 files changed, 8 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 2998c81..f7ee08b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS += -Wall -Wextra -O2
+CFLAGS += -Wall -Wextra -O2 -mssse3
LDFLAGS += -lssl -lcrypto -lpthread
all: sand-leek
diff --git a/onion_base32.c b/onion_base32.c
index 041ac3e..78753ab 100644
--- a/onion_base32.c
+++ b/onion_base32.c
@@ -35,7 +35,7 @@ onion_base32(char output[16], unsigned char sum[20]) {
}
}
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
#include <tmmintrin.h>
/* A slightly-parallel base32 algorithm using SSSE3
@@ -99,4 +99,4 @@ onion_base32_ssse3(char output[16], unsigned char sum[20]) {
_mm_storeu_si128((__m128i*)output, l|n);
}
-#endif /* ifdef SSSE3_ONION_BASE32 */
+#endif /* ifdef __SSSE3__ */
diff --git a/onion_base32.h b/onion_base32.h
index 9377915..c196dea 100644
--- a/onion_base32.h
+++ b/onion_base32.h
@@ -1,6 +1,6 @@
int check_base32(char *);
void onion_base32(char [16], unsigned char (*));
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
void onion_base32_ssse3(char [16], unsigned char (*));
#endif
diff --git a/sand-leek.c b/sand-leek.c
index 8554960..160987b 100644
--- a/sand-leek.c
+++ b/sand-leek.c
@@ -92,7 +92,7 @@ key_update_d(RSA *rsa_key) {
void*
work(void *arg) {
char onion[17];
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
char check_onion[17]; /* buffer for onion address used in sanity check */
#endif
unsigned char sha[20];
@@ -157,7 +157,7 @@ work(void *arg) {
SHA1_Update(&working_sha_c, &e_big_endian, EXPONENT_SIZE_BYTES);
SHA1_Final((unsigned char*)&sha, &working_sha_c);
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
onion_base32_ssse3(onion, sha);
#else
onion_base32(onion, sha);
@@ -174,7 +174,7 @@ work(void *arg) {
goto STOP;
}
if(strncmp(onion, search, search_len) == 0) {
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
/* sanity check: my SSE algorithm is still experimental, so
* check it with old trusty */
onion_base32(check_onion, sha);
@@ -271,7 +271,7 @@ monitor_progress(unsigned long volatile *khashes, int thread_count) {
void
show_version(void) {
-#ifdef SSSE3_ONION_BASE32
+#ifdef __SSSE3__
# define EXTENSIONS "SSSE3 Base32 Algorithm"
#else
# define EXTENSIONS "None"