Browse Source

Add self-test for AES and AES-GCM using public test vectors.

Adam Ierymenko 6 years ago
parent
commit
f83ae0e39e
2 changed files with 4 additions and 3 deletions
  1. 3 3
      make-mac.mk
  2. 1 0
      selftest.cpp

+ 3 - 3
make-mac.mk

@@ -56,14 +56,14 @@ endif
 # Debug mode -- dump trace output, build binary with -g
 # Debug mode -- dump trace output, build binary with -g
 ifeq ($(ZT_DEBUG),1)
 ifeq ($(ZT_DEBUG),1)
 	ZT_TRACE=1
 	ZT_TRACE=1
-	CFLAGS+=-Wall -g $(INCLUDES) $(DEFS)
+	CFLAGS+=-Wall -g -maes -mpclmul $(INCLUDES) $(DEFS)
 	STRIP=echo
 	STRIP=echo
 	# The following line enables optimization for the crypto code, since
 	# The following line enables optimization for the crypto code, since
 	# C25519 in particular is almost UNUSABLE in heavy testing without it.
 	# C25519 in particular is almost UNUSABLE in heavy testing without it.
-node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g $(INCLUDES) $(DEFS)
+node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o node/AES.o: CFLAGS = -Wall -O2 -g -maes -mpclmul $(INCLUDES) $(DEFS)
 else
 else
 	CFLAGS?=-Ofast -fstack-protector-strong
 	CFLAGS?=-Ofast -fstack-protector-strong
-	CFLAGS+=$(ARCH_FLAGS) -Wall -flto -fPIE -mmacosx-version-min=10.7 -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
+	CFLAGS+=$(ARCH_FLAGS) -Wall -flto -fPIE -maes -msse -msse2 -mpclmul -mmacosx-version-min=10.9 -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
 	STRIP=strip
 	STRIP=strip
 endif
 endif
 
 

File diff suppressed because it is too large
+ 1 - 0
selftest.cpp


Some files were not shown because too many files changed in this diff