shithub: blake2

Download patch

ref: d51174678721048e1f7a05c2f3d537d42b550c36
parent: 9a57356891b7b2a1c0fcf0895e0155f468b5815a
author: Samuel Neves <sneves@dei.uc.pt>
date: Fri Jun 10 07:37:44 EDT 2016

fix kat paths; better sse2 detection

--- a/bench/makefile
+++ b/bench/makefile
@@ -3,9 +3,9 @@
 CFLAGS=-std=gnu99 -O3 -march=native -DSUPERCOP # -DHAVE_XOP # uncomment on XOP-enabled CPUs
 FILES=amd64cpuinfo.c bench.c
 
-all:	
-	$(CC) $(FILES) $(CFLAGS) ../sse/blake2b.c -o blake2b 
-	$(CC) $(FILES) $(CFLAGS) ../sse/blake2s.c -o blake2s 
+all:
+	$(CC) $(FILES) $(CFLAGS) ../sse/blake2b.c -o blake2b
+	$(CC) $(FILES) $(CFLAGS) ../sse/blake2s.c -o blake2s
 	$(CC) $(FILES) $(CFLAGS) md5.c -o md5  -lcrypto -lz
 	./blake2b > blake2b.data
 	./blake2s > blake2s.data
--- a/ref/makefile
+++ b/ref/makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-std=c99 -Wall -pedantic
+CFLAGS=-std=c99 -Wall -pedantic -I../testvectors
 
 all:		blake2s blake2b blake2sp blake2bp
 
--- a/sse/blake2-config.h
+++ b/sse/blake2-config.h
@@ -1,14 +1,14 @@
 /*
    BLAKE2 reference source code package - optimized C implementations
-  
+
    Copyright 2012, Samuel Neves <sneves@dei.uc.pt>.  You may use this under the
    terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
    your option.  The terms of these licenses can be found at:
-  
+
    - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
    - OpenSSL license   : https://www.openssl.org/source/license.html
    - Apache 2.0        : http://www.apache.org/licenses/LICENSE-2.0
-  
+
    More information about the BLAKE2 hash function can be found at
    https://blake2.net.
 */
@@ -17,7 +17,7 @@
 #define __BLAKE2_CONFIG_H__
 
 // These don't work everywhere
-#if defined(__SSE2__)
+#if defined(__SSE2__) || defined(__x86_64__) || defined(__amd64__)
 #define HAVE_SSE2
 #endif
 
--- a/sse/makefile
+++ b/sse/makefile
@@ -1,5 +1,5 @@
 CC=gcc
-CFLAGS=-std=c99 -Wall -pedantic -O3 -march=native
+CFLAGS=-std=c99 -Wall -pedantic -O3 -march=native -I../testvectors
 
 all:		blake2s blake2b blake2sp blake2bp
 
@@ -21,5 +21,5 @@
 		./genkat-c > blake2-kat.h
 		./genkat-json > blake2-kat.json
 
-clean:		
+clean:
 		rm -rf *.o blake2s blake2b blake2sp blake2bp genkat-c genkat-json
--