From 14bebe460b1d436ac125e5a5174abe01457bea68 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 27 Feb 2017 00:19:42 +0100 Subject: [PATCH] Allow compilation without a working x86_64 assembler --- src/libsodium/Makefile.am | 5 +++-- src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index af29650c..927752f8 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -81,8 +81,6 @@ libsodium_la_SOURCES = \ crypto_stream/crypto_stream.c \ crypto_stream/salsa20/stream_salsa20.c \ crypto_stream/salsa20/stream_salsa20.h \ - crypto_stream/salsa20/ref/salsa20_ref.c \ - crypto_stream/salsa20/ref/salsa20_ref.h \ crypto_stream/xsalsa20/stream_xsalsa20.c \ crypto_verify/sodium/verify.c \ include/sodium/private/common.h \ @@ -123,6 +121,9 @@ libsodium_la_SOURCES += \ crypto_stream/salsa20/xmm6/salsa20_xmm6-asm.S \ crypto_stream/salsa20/xmm6/salsa20_xmm6.c \ crypto_stream/salsa20/xmm6/salsa20_xmm6.h +else + crypto_stream/salsa20/ref/salsa20_ref.c \ + crypto_stream/salsa20/ref/salsa20_ref.h endif noinst_HEADERS = \ diff --git a/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c b/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c index 47f3ba29..f0854ebf 100644 --- a/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c +++ b/src/libsodium/crypto_stream/salsa20/ref/salsa20_ref.c @@ -13,7 +13,7 @@ Public domain. #include "../stream_salsa20.h" #include "salsa20_ref.h" -#if !(defined(HAVE_EMMINTRIN_H) && defined(__x86_64__)) +#ifndef HAVE_AMD64_ASM static int stream_ref(unsigned char *c, unsigned long long clen, const unsigned char *n,