diff options
author | lealem47 <60322859+lealem47@users.noreply.github.com> | 2023-11-12 16:51:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-13 00:51:31 +0100 |
commit | 9247ce1bb90c44d19a0069fadb12c0c480ac9b4f (patch) | |
tree | 66fb4728d502759271d03eba59d51c1a129b2ffb /src/Volume/Volume.make | |
parent | 458be85f84a097aa829658c50ce41d82791fb6a8 (diff) | |
download | VeraCrypt-9247ce1bb90c44d19a0069fadb12c0c480ac9b4f.tar.gz VeraCrypt-9247ce1bb90c44d19a0069fadb12c0c480ac9b4f.zip |
wolfCrypt as crypto backend for VeraCrypt (#1227)
* wolfCrypt as crypto backend for VeraCrypt
* Refactor to use EncryptionModeWolfCryptXTS class
Diffstat (limited to 'src/Volume/Volume.make')
-rw-r--r-- | src/Volume/Volume.make | 192 |
1 files changed, 103 insertions, 89 deletions
diff --git a/src/Volume/Volume.make b/src/Volume/Volume.make index d69ec135..f81df229 100644 --- a/src/Volume/Volume.make +++ b/src/Volume/Volume.make @@ -16,7 +16,6 @@ OBJSNOOPT := OBJS += Cipher.o OBJS += EncryptionAlgorithm.o OBJS += EncryptionMode.o -OBJS += EncryptionModeXTS.o OBJS += EncryptionTest.o OBJS += EncryptionThreadPool.o OBJS += Hash.o @@ -30,58 +29,68 @@ OBJS += VolumeLayout.o OBJS += VolumePassword.o OBJS += VolumePasswordCache.o -ifeq "$(PLATFORM)" "MacOSX" - OBJSEX += ../Crypto/Aes_asm.oo - OBJS += ../Crypto/Aes_hw_cpu.o - OBJS += ../Crypto/Aescrypt.o - OBJSEX += ../Crypto/Twofish_asm.oo - OBJSEX += ../Crypto/Camellia_asm.oo - OBJSEX += ../Crypto/Camellia_aesni_asm.oo - OBJSEX += ../Crypto/sha256-nayuki.oo - OBJSEX += ../Crypto/sha512-nayuki.oo - OBJSEX += ../Crypto/sha256_avx1.oo - OBJSEX += ../Crypto/sha256_avx2.oo - OBJSEX += ../Crypto/sha256_sse4.oo - OBJSEX += ../Crypto/sha512_avx1.oo - OBJSEX += ../Crypto/sha512_avx2.oo - OBJSEX += ../Crypto/sha512_sse4.oo -else ifeq "$(CPU_ARCH)" "x86" - OBJS += ../Crypto/Aes_x86.o -ifeq "$(DISABLE_AESNI)" "0" - OBJS += ../Crypto/Aes_hw_cpu.o -endif - OBJS += ../Crypto/sha256-x86-nayuki.o - OBJS += ../Crypto/sha512-x86-nayuki.o -else ifeq "$(CPU_ARCH)" "x64" - OBJS += ../Crypto/Aes_x64.o -ifeq "$(DISABLE_AESNI)" "0" - OBJS += ../Crypto/Aes_hw_cpu.o -endif - OBJS += ../Crypto/Twofish_x64.o - OBJS += ../Crypto/Camellia_x64.o - OBJS += ../Crypto/Camellia_aesni_x64.o - OBJS += ../Crypto/sha512-x64-nayuki.o - OBJS += ../Crypto/sha256_avx1_x64.o - OBJS += ../Crypto/sha256_avx2_x64.o - OBJS += ../Crypto/sha256_sse4_x64.o - OBJS += ../Crypto/sha512_avx1_x64.o - OBJS += ../Crypto/sha512_avx2_x64.o - OBJS += ../Crypto/sha512_sse4_x64.o +ifeq "$(ENABLE_WOLFCRYPT)" "0" +OBJS += EncryptionModeXTS.o else - OBJS += ../Crypto/Aescrypt.o +OBJS += EncryptionModeWolfCryptXTS.o endif -ifeq "$(GCC_GTEQ_430)" "1" -OBJSSSE41 += ../Crypto/blake2s_SSE41.osse41 -OBJSSSSE3 += ../Crypto/blake2s_SSSE3.ossse3 +ifeq "$(ENABLE_WOLFCRYPT)" "0" + ifeq "$(PLATFORM)" "MacOSX" + OBJSEX += ../Crypto/Aes_asm.oo + OBJS += ../Crypto/Aes_hw_cpu.o + OBJS += ../Crypto/Aescrypt.o + OBJSEX += ../Crypto/Twofish_asm.oo + OBJSEX += ../Crypto/Camellia_asm.oo + OBJSEX += ../Crypto/Camellia_aesni_asm.oo + OBJSEX += ../Crypto/sha256-nayuki.oo + OBJSEX += ../Crypto/sha512-nayuki.oo + OBJSEX += ../Crypto/sha256_avx1.oo + OBJSEX += ../Crypto/sha256_avx2.oo + OBJSEX += ../Crypto/sha256_sse4.oo + OBJSEX += ../Crypto/sha512_avx1.oo + OBJSEX += ../Crypto/sha512_avx2.oo + OBJSEX += ../Crypto/sha512_sse4.oo + else ifeq "$(CPU_ARCH)" "x86" + OBJS += ../Crypto/Aes_x86.o + ifeq "$(DISABLE_AESNI)" "0" + OBJS += ../Crypto/Aes_hw_cpu.o + endif + OBJS += ../Crypto/sha256-x86-nayuki.o + OBJS += ../Crypto/sha512-x86-nayuki.o + else ifeq "$(CPU_ARCH)" "x64" + OBJS += ../Crypto/Aes_x64.o + ifeq "$(DISABLE_AESNI)" "0" + OBJS += ../Crypto/Aes_hw_cpu.o + endif + OBJS += ../Crypto/Twofish_x64.o + OBJS += ../Crypto/Camellia_x64.o + OBJS += ../Crypto/Camellia_aesni_x64.o + OBJS += ../Crypto/sha512-x64-nayuki.o + OBJS += ../Crypto/sha256_avx1_x64.o + OBJS += ../Crypto/sha256_avx2_x64.o + OBJS += ../Crypto/sha256_sse4_x64.o + OBJS += ../Crypto/sha512_avx1_x64.o + OBJS += ../Crypto/sha512_avx2_x64.o + OBJS += ../Crypto/sha512_sse4_x64.o + else + OBJS += ../Crypto/Aescrypt.o + endif + + ifeq "$(GCC_GTEQ_430)" "1" + OBJSSSE41 += ../Crypto/blake2s_SSE41.osse41 + OBJSSSSE3 += ../Crypto/blake2s_SSSE3.ossse3 + else + OBJS += ../Crypto/blake2s_SSE41.o + OBJS += ../Crypto/blake2s_SSSE3.o + endif else -OBJS += ../Crypto/blake2s_SSE41.o -OBJS += ../Crypto/blake2s_SSSE3.o + OBJS += ../Crypto/wolfCrypt.o endif +ifeq "$(ENABLE_WOLFCRYPT)" "0" OBJS += ../Crypto/Aeskey.o OBJS += ../Crypto/Aestab.o -OBJS += ../Crypto/cpu.o OBJS += ../Crypto/blake2s.o OBJS += ../Crypto/blake2s_SSE2.o OBJS += ../Crypto/SerpentFast.o @@ -93,6 +102,10 @@ OBJS += ../Crypto/Camellia.o OBJS += ../Crypto/Streebog.o OBJS += ../Crypto/kuznyechik.o OBJS += ../Crypto/kuznyechik_simd.o +OBJS += ../Common/Pkcs5.o +endif + +OBJS += ../Crypto/cpu.o OBJSNOOPT += ../Crypto/jitterentropy-base.o0 @@ -110,54 +123,55 @@ OBJS += ../Common/EMVCard.o OBJS += ../Common/EMVToken.o OBJS += ../Common/Endian.o OBJS += ../Common/GfMul.o -OBJS += ../Common/Pkcs5.o OBJS += ../Common/SecurityToken.o VolumeLibrary: Volume.a -ifeq "$(PLATFORM)" "MacOSX" -../Crypto/Aes_asm.oo: ../Crypto/Aes_x86.asm ../Crypto/Aes_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS32) -o ../Crypto/Aes_x86.o ../Crypto/Aes_x86.asm - $(AS) $(ASFLAGS64) -o ../Crypto/Aes_x64.o ../Crypto/Aes_x64.asm - lipo -create ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o -output ../Crypto/Aes_asm.oo - rm -fr ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o -../Crypto/Twofish_asm.oo: ../Crypto/Twofish_x64.S - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Twofish_asm.oo ../Crypto/Twofish_x64.S -../Crypto/Camellia_asm.oo: ../Crypto/Camellia_x64.S - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_asm.oo ../Crypto/Camellia_x64.S -../Crypto/Camellia_aesni_asm.oo: ../Crypto/Camellia_aesni_x64.S - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_aesni_asm.oo ../Crypto/Camellia_aesni_x64.S -../Crypto/sha256-nayuki.oo: ../Crypto/sha256-x86-nayuki.S - @echo Assembling $(<F) - $(AS) $(ASFLAGS32) -p gas -o ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x86-nayuki.S - $(AS) $(ASFLAGS64) -p gas -o ../Crypto/sha256-x64-nayuki.o ../Crypto/sha256-x64-nayuki.S - lipo -create ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x64-nayuki.o -output ../Crypto/sha256-nayuki.oo - rm -fr ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x64-nayuki.o -../Crypto/sha256_avx1.oo: ../Crypto/sha256_avx1_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx1.oo ../Crypto/sha256_avx1_x64.asm -../Crypto/sha256_avx2.oo: ../Crypto/sha256_avx2_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx2.oo ../Crypto/sha256_avx2_x64.asm -../Crypto/sha256_sse4.oo: ../Crypto/sha256_sse4_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha256_sse4.oo ../Crypto/sha256_sse4_x64.asm -../Crypto/sha512-nayuki.oo: ../Crypto/sha512-x64-nayuki.S - @echo Assembling $(<F) - $(AS) -p gas $(ASFLAGS64) -o ../Crypto/sha512-nayuki.oo ../Crypto/sha512-x64-nayuki.S -../Crypto/sha512_avx1.oo: ../Crypto/sha512_avx1_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx1.oo ../Crypto/sha512_avx1_x64.asm -../Crypto/sha512_avx2.oo: ../Crypto/sha512_avx2_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx2.oo ../Crypto/sha512_avx2_x64.asm -../Crypto/sha512_sse4.oo: ../Crypto/sha512_sse4_x64.asm - @echo Assembling $(<F) - $(AS) $(ASFLAGS64) -o ../Crypto/sha512_sse4.oo ../Crypto/sha512_sse4_x64.asm +ifeq "$(ENABLE_WOLFCRYPT)" "0" + ifeq "$(PLATFORM)" "MacOSX" + ../Crypto/Aes_asm.oo: ../Crypto/Aes_x86.asm ../Crypto/Aes_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS32) -o ../Crypto/Aes_x86.o ../Crypto/Aes_x86.asm + $(AS) $(ASFLAGS64) -o ../Crypto/Aes_x64.o ../Crypto/Aes_x64.asm + lipo -create ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o -output ../Crypto/Aes_asm.oo + rm -fr ../Crypto/Aes_x86.o ../Crypto/Aes_x64.o + ../Crypto/Twofish_asm.oo: ../Crypto/Twofish_x64.S + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Twofish_asm.oo ../Crypto/Twofish_x64.S + ../Crypto/Camellia_asm.oo: ../Crypto/Camellia_x64.S + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_asm.oo ../Crypto/Camellia_x64.S + ../Crypto/Camellia_aesni_asm.oo: ../Crypto/Camellia_aesni_x64.S + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -p gas -o ../Crypto/Camellia_aesni_asm.oo ../Crypto/Camellia_aesni_x64.S + ../Crypto/sha256-nayuki.oo: ../Crypto/sha256-x86-nayuki.S + @echo Assembling $(<F) + $(AS) $(ASFLAGS32) -p gas -o ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x86-nayuki.S + $(AS) $(ASFLAGS64) -p gas -o ../Crypto/sha256-x64-nayuki.o ../Crypto/sha256-x64-nayuki.S + lipo -create ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x64-nayuki.o -output ../Crypto/sha256-nayuki.oo + rm -fr ../Crypto/sha256-x86-nayuki.o ../Crypto/sha256-x64-nayuki.o + ../Crypto/sha256_avx1.oo: ../Crypto/sha256_avx1_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx1.oo ../Crypto/sha256_avx1_x64.asm + ../Crypto/sha256_avx2.oo: ../Crypto/sha256_avx2_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha256_avx2.oo ../Crypto/sha256_avx2_x64.asm + ../Crypto/sha256_sse4.oo: ../Crypto/sha256_sse4_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha256_sse4.oo ../Crypto/sha256_sse4_x64.asm + ../Crypto/sha512-nayuki.oo: ../Crypto/sha512-x64-nayuki.S + @echo Assembling $(<F) + $(AS) -p gas $(ASFLAGS64) -o ../Crypto/sha512-nayuki.oo ../Crypto/sha512-x64-nayuki.S + ../Crypto/sha512_avx1.oo: ../Crypto/sha512_avx1_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx1.oo ../Crypto/sha512_avx1_x64.asm + ../Crypto/sha512_avx2.oo: ../Crypto/sha512_avx2_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha512_avx2.oo ../Crypto/sha512_avx2_x64.asm + ../Crypto/sha512_sse4.oo: ../Crypto/sha512_sse4_x64.asm + @echo Assembling $(<F) + $(AS) $(ASFLAGS64) -o ../Crypto/sha512_sse4.oo ../Crypto/sha512_sse4_x64.asm + endif endif include $(BUILD_INC)/Makefile.inc |