diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-06-23 02:07:32 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2017-06-23 02:11:21 +0200 |
commit | 546d6cff4447a56bbf7c0e1a8b6f89dba5d3183b (patch) | |
tree | 7f8bfb3f7e7c6a0aab662fe6dec944cd6ee1a874 /src/Driver | |
parent | ab7b5dc685eab3235dd748d8791cb39085ab0394 (diff) | |
download | VeraCrypt-546d6cff4447a56bbf7c0e1a8b6f89dba5d3183b.tar.gz VeraCrypt-546d6cff4447a56bbf7c0e1a8b6f89dba5d3183b.zip |
Crypto: Add optimized SHA-512 and SHA-256 assembly implementations for x86_64 and x86. This improves speed by 30%.
Diffstat (limited to 'src/Driver')
-rw-r--r-- | src/Driver/DriveFilter.c | 4 | ||||
-rw-r--r-- | src/Driver/Driver.vcxproj | 27 | ||||
-rw-r--r-- | src/Driver/Driver.vcxproj.filters | 27 |
3 files changed, 56 insertions, 2 deletions
diff --git a/src/Driver/DriveFilter.c b/src/Driver/DriveFilter.c index 8195fe35..d46bd92e 100644 --- a/src/Driver/DriveFilter.c +++ b/src/Driver/DriveFilter.c @@ -330,7 +330,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte* #if !defined (_WIN64) KFLOATING_SAVE floatingPointState; NTSTATUS saveStatus = STATUS_SUCCESS; - if (HasISSE()) + if (HasISSE()|| (HasSSE2() && HasMMX())) saveStatus = KeSaveFloatingPointState (&floatingPointState); #endif WHIRLPOOL_add (ioBuffer, TC_BOOT_SECTOR_PIM_VALUE_OFFSET, &whirlpool); @@ -368,7 +368,7 @@ static void ComputeBootLoaderFingerprint(PDEVICE_OBJECT LowerDeviceObject, byte* } #if !defined (_WIN64) - if (NT_SUCCESS (saveStatus) && HasISSE()) + if (NT_SUCCESS (saveStatus) && (HasISSE() || (HasSSE2() && HasMMX()))) KeRestoreFloatingPointState (&floatingPointState); #endif } diff --git a/src/Driver/Driver.vcxproj b/src/Driver/Driver.vcxproj index a108f426..381d2083 100644 --- a/src/Driver/Driver.vcxproj +++ b/src/Driver/Driver.vcxproj @@ -225,6 +225,33 @@ BuildDriver.cmd -rebuild -debug -x64 "$(SolutionDir)\Common" "$(SolutionDir)\Cry <None Include="..\Crypto\Aes_x86.asm" /> <None Include="..\Crypto\Camellia_aesni_x64.S" /> <None Include="..\Crypto\Camellia_x64.S" /> + <None Include="..\Crypto\sha256-x86-nayuki.S"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha256_avx1_x64.asm"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha256_avx2_x64.asm"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha256_sse4_x64.asm"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha512-x64-nayuki.S"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha512-x86-nayuki.S"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha512_avx1_x64.asm"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha512_avx2_x64.asm"> + <FileType>Document</FileType> + </None> + <None Include="..\Crypto\sha512_sse4_x64.asm"> + <FileType>Document</FileType> + </None> <None Include="..\Crypto\Twofish_x64.S" /> <None Include="BuildDriver.cmd" /> <None Include="Makefile" /> diff --git a/src/Driver/Driver.vcxproj.filters b/src/Driver/Driver.vcxproj.filters index 5a44984d..3622c7a8 100644 --- a/src/Driver/Driver.vcxproj.filters +++ b/src/Driver/Driver.vcxproj.filters @@ -152,6 +152,33 @@ <None Include="..\Crypto\Twofish_x64.S"> <Filter>Source Files\Crypto</Filter> </None> + <None Include="..\Crypto\sha256-x86-nayuki.S"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha512_sse4_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha256_avx1_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha256_avx2_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha256_sse4_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha512-x86-nayuki.S"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha512-x64-nayuki.S"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha512_avx1_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> + <None Include="..\Crypto\sha512_avx2_x64.asm"> + <Filter>Source Files\Crypto</Filter> + </None> </ItemGroup> <ItemGroup> <ClInclude Include="..\Common\Apidrvr.h"> |