Skip to content

Commit

Permalink
Use NanaZip Platform Abstraction Layer (K7Pal) to implement 7-Zip's S…
Browse files Browse the repository at this point in the history
…HA-256 hash algorithms.
  • Loading branch information
MouriNaruto committed Dec 24, 2024
1 parent 27c6fe8 commit cab96cf
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 1,282 deletions.
1 change: 1 addition & 0 deletions NanaZip.Core/NanaZip.Core.Sfx.Shared.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\K7Pal\K7PalStatic.props" />
<PropertyGroup>
<IncludePath>$(MSBuildThisFileDirectory);$(IncludePath)</IncludePath>
</PropertyGroup>
Expand Down
19 changes: 3 additions & 16 deletions NanaZip.Core/NanaZip.Core.Sfx.Shared.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Import Project="..\Mile.Project.Windows\Mile.Project.Cpp.Default.props" />
<Import Project="..\Mile.Project.Windows\Mile.Project.Cpp.props" />
<Import Condition="('$(Platform)'=='Win32') Or ('$(Platform)'=='x64')" Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
<Import Project="..\K7Pal\K7PalStatic.props" />
<ItemDefinitionGroup>
<ClCompile>
<RuntimeLibrary Condition="'$(Configuration)' == 'Debug'">MultiThreadedDebug</RuntimeLibrary>
Expand All @@ -34,10 +35,8 @@
<None Include="SevenZip\ASM\x86\7zCrcOpt.asm" />
<None Include="SevenZip\ASM\x86\AesOpt.asm" />
<None Include="SevenZip\ASM\x86\LzmaDecOpt.asm" />
<None Include="SevenZip\ASM\x86\Sha256Opt.asm" />
<None Include="SevenZip\C\7zCrcOpt.c" />
<None Include="SevenZip\C\AesOpt.c" />
<None Include="SevenZip\C\Sha256Opt.c" />
<None Include="Extensions\ZSCodecs\ZstdRegister.cpp" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -87,7 +86,6 @@
<ClCompile Include="SevenZip\CPP\Common\MyString.cpp" />
<ClCompile Include="SevenZip\CPP\Common\MyVector.cpp" />
<ClCompile Include="SevenZip\CPP\Common\NewHandler.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Sha256Prepare.cpp" />
<ClCompile Include="SevenZip\CPP\Common\StringConvert.cpp" />
<ClCompile Include="SevenZip\CPP\Common\UTFConvert.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Wildcard.cpp" />
Expand Down Expand Up @@ -116,10 +114,10 @@
<ClCompile Include="SevenZip\C\MtDec.c" />
<ClCompile Include="SevenZip\C\Ppmd7.c" />
<ClCompile Include="SevenZip\C\Ppmd7Dec.c" />
<ClCompile Include="SevenZip\C\Sha256.c" />
<ClCompile Include="SevenZip\C\Threads.c" />
<ClCompile Include="SevenZip\C\Xxh64.c" />
<ClCompile Include="SevenZip\C\ZstdDec.c" />
<ClCompile Include="Wrappers\Sha256Wrapper.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="SevenZip\CPP\7zip\Archive\7z\7zCompressionMode.h" />
Expand Down Expand Up @@ -228,6 +226,7 @@
<ClInclude Include="SevenZip\C\Threads.h" />
<ClInclude Include="SevenZip\C\Xxh64.h" />
<ClInclude Include="SevenZip\C\ZstdDec.h" />
<ClInclude Include="Wrappers\Sha256Wrapper.h" />
</ItemGroup>
<ItemGroup>
<Text Include="SevenZip\CPP\7zip\Guid.txt" />
Expand All @@ -249,18 +248,6 @@
<MASM Include="SevenZip\ASM\x86\LzmaDecOpt.asm" />
</ItemGroup>
</Target>
<Target Name="NanaZipCoreSha256HardwareAccelerationBuildAssemblySource" BeforeTargets="_MASM">
<ItemGroup Condition="('$(Platform)'=='Win32') Or ('$(Platform)'=='x64')">
<MASM Include="SevenZip\ASM\x86\Sha256Opt.asm" />
</ItemGroup>
</Target>
<Target Name="NanaZipCoreSha256HardwareAccelerationBuildCSource" BeforeTargets="BeforeClCompile">
<ItemGroup Condition="('$(Platform)'!='Win32') And ('$(Platform)'!='x64')">
<ClCompile Include="SevenZip\C\Sha256Opt.c">
<Optimization Condition="'$(Configuration)'=='Release'">MaxSpeed</Optimization>
</ClCompile>
</ItemGroup>
</Target>
<Target Name="NanaZipCoreCrcHardwareAccelerationBuildAssemblySource" BeforeTargets="_MASM">
<ItemGroup Condition="('$(Platform)'=='Win32') Or ('$(Platform)'=='x64')">
<MASM Include="SevenZip\ASM\x86\7zCrcOpt.asm" />
Expand Down
21 changes: 9 additions & 12 deletions NanaZip.Core/NanaZip.Core.Sfx.Shared.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<Filter Include="Extensions\ZSCodecs">
<UniqueIdentifier>{1f305354-6929-465a-96f8-c10248b20758}</UniqueIdentifier>
</Filter>
<Filter Include="Wrappers">
<UniqueIdentifier>{f2cb8db9-ad05-4731-87cb-b0ff70879041}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="NanaZip.Core.Sfx.Shared.props" />
Expand All @@ -64,12 +67,6 @@
<None Include="SevenZip\C\AesOpt.c">
<Filter>SevenZip\C</Filter>
</None>
<None Include="SevenZip\ASM\x86\Sha256Opt.asm">
<Filter>SevenZip\ASM\x86</Filter>
</None>
<None Include="SevenZip\C\Sha256Opt.c">
<Filter>SevenZip\C</Filter>
</None>
<None Include="SevenZip\ASM\x86\7zCrcOpt.asm">
<Filter>SevenZip\ASM\x86</Filter>
</None>
Expand Down Expand Up @@ -165,12 +162,6 @@
<ClCompile Include="SevenZip\C\Threads.c">
<Filter>SevenZip\C</Filter>
</ClCompile>
<ClCompile Include="SevenZip\C\Sha256.c">
<Filter>SevenZip\C</Filter>
</ClCompile>
<ClCompile Include="SevenZip\CPP\Common\Sha256Prepare.cpp">
<Filter>SevenZip\CPP\Common</Filter>
</ClCompile>
<ClCompile Include="SevenZip\CPP\7zip\Archive\Common\MultiStream.cpp">
<Filter>SevenZip\CPP\7zip\Archive\Common</Filter>
</ClCompile>
Expand Down Expand Up @@ -318,6 +309,9 @@
<ClCompile Include="SevenZip\CPP\7zip\Compress\ZstdDecoder.cpp">
<Filter>SevenZip\CPP\7zip\Compress</Filter>
</ClCompile>
<ClCompile Include="Wrappers\Sha256Wrapper.cpp">
<Filter>Wrappers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SevenZip\C\Aes.h">
Expand Down Expand Up @@ -638,6 +632,9 @@
<ClInclude Include="SevenZip\CPP\7zip\Compress\ZstdDecoder.h">
<Filter>SevenZip\CPP\7zip\Compress</Filter>
</ClInclude>
<ClInclude Include="Wrappers\Sha256Wrapper.h">
<Filter>Wrappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="SevenZip\CPP\7zip\Guid.txt">
Expand Down
18 changes: 2 additions & 16 deletions NanaZip.Core/NanaZip.Core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@
<None Include="SevenZip\ASM\x86\LzFindOpt.asm" />
<None Include="SevenZip\ASM\x86\LzmaDecOpt.asm" />
<None Include="SevenZip\ASM\x86\Sha1Opt.asm" />
<None Include="SevenZip\ASM\x86\Sha256Opt.asm" />
<None Include="SevenZip\ASM\x86\XzCrc64Opt.asm" />
<None Include="SevenZip\CPP\7zip\Archive\Archive2.def" />
<None Include="SevenZip\C\7zCrcOpt.c" />
<None Include="SevenZip\C\AesOpt.c" />
<None Include="SevenZip\C\Sha256Opt.c" />
<None Include="SevenZip\C\XzCrc64Opt.c" />
<None Include="SevenZip\C\LzFindOpt.c" />
<None Include="SevenZip\C\Sha1Opt.c" />
Expand Down Expand Up @@ -294,7 +292,6 @@
<ClCompile Include="SevenZip\CPP\Common\NewHandler.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Sha1Prepare.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Sha1Reg.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Sha256Prepare.cpp" />
<ClCompile Include="SevenZip\CPP\Common\Sha256Reg.cpp" />
<ClCompile Include="SevenZip\CPP\Common\StringConvert.cpp" />
<ClCompile Include="SevenZip\CPP\Common\StringToInt.cpp" />
Expand Down Expand Up @@ -344,7 +341,6 @@
<ClCompile Include="SevenZip\C\Ppmd8Dec.c" />
<ClCompile Include="SevenZip\C\Ppmd8Enc.c" />
<ClCompile Include="SevenZip\C\Sha1.c" />
<ClCompile Include="SevenZip\C\Sha256.c" />
<ClCompile Include="SevenZip\C\Sort.c" />
<ClCompile Include="SevenZip\C\SwapBytes.c" />
<ClCompile Include="SevenZip\C\Threads.c" />
Expand All @@ -355,6 +351,7 @@
<ClCompile Include="SevenZip\C\XzEnc.c" />
<ClCompile Include="SevenZip\C\XzIn.c" />
<ClCompile Include="SevenZip\C\ZstdDec.c" />
<ClCompile Include="Wrappers\Sha256Wrapper.cpp" />
<ClCompile Include="Wrappers\Sha512Wrapper.cpp" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -617,6 +614,7 @@
<ClInclude Include="SevenZip\C\XzCrc64.h" />
<ClInclude Include="SevenZip\C\XzEnc.h" />
<ClInclude Include="SevenZip\C\ZstdDec.h" />
<ClInclude Include="Wrappers\Sha256Wrapper.h" />
<ClInclude Include="Wrappers\Sha512Wrapper.h" />
</ItemGroup>
<ItemGroup>
Expand Down Expand Up @@ -651,18 +649,6 @@
<MASM Include="SevenZip\ASM\x86\LzmaDecOpt.asm" />
</ItemGroup>
</Target>
<Target Name="NanaZipCoreSha256HardwareAccelerationBuildAssemblySource" BeforeTargets="_MASM">
<ItemGroup Condition="('$(Platform)'=='Win32') Or ('$(Platform)'=='x64')">
<MASM Include="SevenZip\ASM\x86\Sha256Opt.asm" />
</ItemGroup>
</Target>
<Target Name="NanaZipCoreSha256HardwareAccelerationBuildCSource" BeforeTargets="BeforeClCompile">
<ItemGroup Condition="('$(Platform)'!='Win32') And ('$(Platform)'!='x64')">
<ClCompile Include="SevenZip\C\Sha256Opt.c">
<Optimization Condition="'$(Configuration)'=='Release'">MaxSpeed</Optimization>
</ClCompile>
</ItemGroup>
</Target>
<Target Name="NanaZipCoreCrc64HardwareAccelerationBuildAssemblySource" BeforeTargets="_MASM">
<ItemGroup Condition="('$(Platform)'=='Win32') Or ('$(Platform)'=='x64')">
<MASM Include="SevenZip\ASM\x86\XzCrc64Opt.asm" />
Expand Down
18 changes: 6 additions & 12 deletions NanaZip.Core/NanaZip.Core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@
<None Include="SevenZip\ASM\x86\Sha1Opt.asm">
<Filter>SevenZip\ASM\x86</Filter>
</None>
<None Include="SevenZip\ASM\x86\Sha256Opt.asm">
<Filter>SevenZip\ASM\x86</Filter>
</None>
<None Include="SevenZip\ASM\x86\XzCrc64Opt.asm">
<Filter>SevenZip\ASM\x86</Filter>
</None>
Expand All @@ -114,9 +111,6 @@
<None Include="SevenZip\C\AesOpt.c">
<Filter>SevenZip\C</Filter>
</None>
<None Include="SevenZip\C\Sha256Opt.c">
<Filter>SevenZip\C</Filter>
</None>
<None Include="SevenZip\C\LzFindOpt.c">
<Filter>SevenZip\C</Filter>
</None>
Expand Down Expand Up @@ -905,12 +899,6 @@
<ClCompile Include="SevenZip\C\Aes.c">
<Filter>SevenZip\C</Filter>
</ClCompile>
<ClCompile Include="SevenZip\C\Sha256.c">
<Filter>SevenZip\C</Filter>
</ClCompile>
<ClCompile Include="SevenZip\CPP\Common\Sha256Prepare.cpp">
<Filter>SevenZip\CPP\Common</Filter>
</ClCompile>
<ClCompile Include="SevenZip\C\Sha1.c">
<Filter>SevenZip\C</Filter>
</ClCompile>
Expand Down Expand Up @@ -1004,6 +992,9 @@
<ClCompile Include="Wrappers\Sha512Wrapper.cpp">
<Filter>Wrappers</Filter>
</ClCompile>
<ClCompile Include="Wrappers\Sha256Wrapper.cpp">
<Filter>Wrappers</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SevenZip\C\7zCrc.h">
Expand Down Expand Up @@ -1786,6 +1777,9 @@
<ClInclude Include="Wrappers\Sha512Wrapper.h">
<Filter>Wrappers</Filter>
</ClInclude>
<ClInclude Include="Wrappers\Sha256Wrapper.h">
<Filter>Wrappers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="SevenZip\CPP\7zip\Guid.txt">
Expand Down
Loading

0 comments on commit cab96cf

Please sign in to comment.