XOR block in specialized ProcessBlock
Use Put and Get blocks consistentlypull/416/head
parent
9b383e8a07
commit
76bb4ead40
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
|
@ -21,20 +21,17 @@
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{94a428a1-9ba8-4db2-b76e-bd2e3c08f257}</ProjectGuid>
|
<ProjectGuid>{94a428a1-9ba8-4db2-b76e-bd2e3c08f257}</ProjectGuid>
|
||||||
<RootNamespace>cryptdll</RootNamespace>
|
<RootNamespace>cryptdll</RootNamespace>
|
||||||
<PlatformToolset>v100</PlatformToolset>
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
|
||||||
<ImportGroup Label="ExtensionSettings" />
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<!-- End of Visual Studio boilerplate -->
|
<!-- End of Visual Studio boilerplate -->
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<PropertyGroup Label="All Configurations">
|
<PropertyGroup Label="All Configurations">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
|
@ -46,7 +43,6 @@
|
||||||
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
|
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
|
||||||
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<ItemDefinitionGroup Label="All Configurations">
|
<ItemDefinitionGroup Label="All Configurations">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -67,7 +63,6 @@
|
||||||
<ImportLibrary>$(TargetDir)\cryptopp.lib</ImportLibrary>
|
<ImportLibrary>$(TargetDir)\cryptopp.lib</ImportLibrary>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Debug Configurations -->
|
<!-- Debug Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -83,7 +78,6 @@
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Release Configurations -->
|
<!-- Release Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -105,7 +99,6 @@
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X86 Configurations -->
|
<!-- X86 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -116,7 +109,6 @@
|
||||||
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X64 Configurations -->
|
<!-- X64 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -126,7 +118,6 @@
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Win32/Debug cryptest.exe for DLL MAC'ing -->
|
<!-- Win32/Debug cryptest.exe for DLL MAC'ing -->
|
||||||
<!-- Broken at the moment; see http://stackoverflow.com/q/39900437 -->
|
<!-- Broken at the moment; see http://stackoverflow.com/q/39900437 -->
|
||||||
<!-- and http://stackoverflow.com/q/39929817/608639 -->
|
<!-- and http://stackoverflow.com/q/39929817/608639 -->
|
||||||
|
|
@ -142,7 +133,6 @@
|
||||||
Properties="Configuration=Debug;Platform=Win32;"/>
|
Properties="Configuration=Debug;Platform=Win32;"/>
|
||||||
</Target>
|
</Target>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<ItemDefinitionGroup Condition="!Exists('Win32\Output\Debug\cryptest.exe')" Label="MAC tool">
|
<ItemDefinitionGroup Condition="!Exists('Win32\Output\Debug\cryptest.exe')" Label="MAC tool">
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
<Message>Creating Win32/Debug cryptest.exe for MAC computation</Message>
|
<Message>Creating Win32/Debug cryptest.exe for MAC computation</Message>
|
||||||
|
|
@ -152,7 +142,6 @@
|
||||||
</Command>
|
</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- DLL MAC'ing performed by cryptest.exe -->
|
<!-- DLL MAC'ing performed by cryptest.exe -->
|
||||||
<ItemDefinitionGroup Label="DLL MAC">
|
<ItemDefinitionGroup Label="DLL MAC">
|
||||||
<PostBuildEvent>
|
<PostBuildEvent>
|
||||||
|
|
@ -165,7 +154,6 @@
|
||||||
<Outputs>$(OutDir)cryptopp.mac.done;%(Outputs)</Outputs>
|
<Outputs>$(OutDir)cryptopp.mac.done;%(Outputs)</Outputs>
|
||||||
</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Original File with special treatment -->
|
<!-- Original File with special treatment -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<CustomBuild Condition="'$(Platform)'=='x64' AND ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release')" Include="x64dll.asm">
|
<CustomBuild Condition="'$(Platform)'=='x64' AND ('$(Configuration)'=='Debug' Or '$(Configuration)'=='Release')" Include="x64dll.asm">
|
||||||
|
|
@ -174,7 +162,6 @@
|
||||||
<Outputs>$(IntDir)x64dll.obj;%(Outputs)</Outputs>
|
<Outputs>$(IntDir)x64dll.obj;%(Outputs)</Outputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Source Files -->
|
<!-- Source Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="pch.cpp">
|
<ClCompile Include="pch.cpp">
|
||||||
|
|
@ -239,7 +226,6 @@
|
||||||
<ClCompile Include="strciphr.cpp" />
|
<ClCompile Include="strciphr.cpp" />
|
||||||
<ClCompile Include="trdlocal.cpp" />
|
<ClCompile Include="trdlocal.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Header Files -->
|
<!-- Header Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="aes.h" />
|
<ClInclude Include="aes.h" />
|
||||||
|
|
@ -310,7 +296,6 @@
|
||||||
<ClInclude Include="trdlocal.h" />
|
<ClInclude Include="trdlocal.h" />
|
||||||
<ClInclude Include="words.h" />
|
<ClInclude Include="words.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Back to Visual Studio boilerplate -->
|
<!-- Back to Visual Studio boilerplate -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="cryptopp.rc" />
|
<ResourceCompile Include="cryptopp.rc" />
|
||||||
|
|
@ -319,4 +304,4 @@
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.targets" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
|
@ -34,16 +34,14 @@
|
||||||
<Platform>x64</Platform>
|
<Platform>x64</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{09cdac08-e6ae-48a9-8de7-0fbc779eebde}</ProjectGuid>
|
<ProjectGuid>{09cdac08-e6ae-48a9-8de7-0fbc779eebde}</ProjectGuid>
|
||||||
<RootNamespace>cryptest</RootNamespace>
|
<RootNamespace>cryptest</RootNamespace>
|
||||||
<PlatformToolset>v100</PlatformToolset>
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
<ImportGroup Label="ExtensionSettings">
|
||||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
<Import Project="$(VCTargetsPath)\BuildCustomizations\masm.props" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
|
@ -52,7 +50,6 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<!-- End of Visual Studio boilerplate -->
|
<!-- End of Visual Studio boilerplate -->
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<PropertyGroup Label="All Configurations">
|
<PropertyGroup Label="All Configurations">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
|
@ -62,7 +59,6 @@
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Intermediate and Output directories -->
|
<!-- Intermediate and Output directories -->
|
||||||
<!-- Cryptlib and Cryptest need extra care due to Non-DLL/DLL configs -->
|
<!-- Cryptlib and Cryptest need extra care due to Non-DLL/DLL configs -->
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'" Label="Non-DLL Directories">
|
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'" Label="Non-DLL Directories">
|
||||||
|
|
@ -77,7 +73,6 @@
|
||||||
<OutDir>$(Platform)\DLL_Output\Release\</OutDir>
|
<OutDir>$(Platform)\DLL_Output\Release\</OutDir>
|
||||||
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<ItemDefinitionGroup Label="All Configurations">
|
<ItemDefinitionGroup Label="All Configurations">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -97,7 +92,6 @@
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Debug Configurations -->
|
<!-- Debug Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DLL-Import Debug'" Label="Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DLL-Import Debug'" Label="Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -113,7 +107,6 @@
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Release Configurations -->
|
<!-- Release Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='DLL-Import Release'" Label="Release Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='DLL-Import Release'" Label="Release Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -135,7 +128,6 @@
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- DLL-Import Overrides for Preprocessor and Libraries -->
|
<!-- DLL-Import Overrides for Preprocessor and Libraries -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -155,7 +147,6 @@
|
||||||
<AdditionalDependencies>cryptopp.lib;cryptlib.lib;Ws2_32.lib</AdditionalDependencies>
|
<AdditionalDependencies>cryptopp.lib;cryptlib.lib;Ws2_32.lib</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X86 Configurations -->
|
<!-- X86 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -166,7 +157,6 @@
|
||||||
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X64 Configurations -->
|
<!-- X64 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -176,7 +166,6 @@
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- FIPS Validated Warning -->
|
<!-- FIPS Validated Warning -->
|
||||||
<ItemDefinitionGroup Label="FIPS Warning">
|
<ItemDefinitionGroup Label="FIPS Warning">
|
||||||
<PreBuildEvent Condition="'$(Configuration)'=='DLL-Import Debug' Or '$(Configuration)'=='DLL-Import Release'">
|
<PreBuildEvent Condition="'$(Configuration)'=='DLL-Import Debug' Or '$(Configuration)'=='DLL-Import Release'">
|
||||||
|
|
@ -190,14 +179,12 @@
|
||||||
</Command>
|
</Command>
|
||||||
</PreBuildEvent>
|
</PreBuildEvent>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Target for Appvoyer -->
|
<!-- Target for Appvoyer -->
|
||||||
<!-- The rule copies cryptest.exe to the project -->
|
<!-- The rule copies cryptest.exe to the project -->
|
||||||
<!-- root directory so it can be executed in place -->
|
<!-- root directory so it can be executed in place -->
|
||||||
<Target Name="CopyCryptestToRoot">
|
<Target Name="CopyCryptestToRoot">
|
||||||
<Exec Command="copy $(Platform)\Output\$(Configuration)\cryptest.exe $(SolutionDir)" />
|
<Exec Command="copy $(Platform)\Output\$(Configuration)\cryptest.exe $(SolutionDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Source Files -->
|
<!-- Source Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="adhoc.cpp" />
|
<ClCompile Include="adhoc.cpp" />
|
||||||
|
|
@ -215,14 +202,12 @@
|
||||||
<ClCompile Include="validat2.cpp" />
|
<ClCompile Include="validat2.cpp" />
|
||||||
<ClCompile Include="validat3.cpp" />
|
<ClCompile Include="validat3.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Header Files -->
|
<!-- Header Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="bench.h" />
|
<ClInclude Include="bench.h" />
|
||||||
<ClInclude Include="factory.h" />
|
<ClInclude Include="factory.h" />
|
||||||
<ClInclude Include="validate.h" />
|
<ClInclude Include="validate.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Test Files -->
|
<!-- Test Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="TestVectors\aes.txt" />
|
<None Include="TestVectors\aes.txt" />
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Filter Include="TestVectors">
|
<Filter Include="TestVectors">
|
||||||
|
|
@ -75,9 +75,6 @@
|
||||||
<None Include="TestVectors\hmac.txt">
|
<None Include="TestVectors\hmac.txt">
|
||||||
<Filter>TestVectors</Filter>
|
<Filter>TestVectors</Filter>
|
||||||
</None>
|
</None>
|
||||||
<None Include="TestVectors\kalyna.txt">
|
|
||||||
<Filter>TestVectors</Filter>
|
|
||||||
</None>
|
|
||||||
<None Include="TestVectors\mars.txt">
|
<None Include="TestVectors\mars.txt">
|
||||||
<Filter>TestVectors</Filter>
|
<Filter>TestVectors</Filter>
|
||||||
</None>
|
</None>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<LocalDebuggerCommandArguments>v</LocalDebuggerCommandArguments>
|
<LocalDebuggerCommandArguments>tv kalyna</LocalDebuggerCommandArguments>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{c39f4b46-6e89-4074-902e-ca57073044d2}</ProjectGuid>
|
<ProjectGuid>{c39f4b46-6e89-4074-902e-ca57073044d2}</ProjectGuid>
|
||||||
<RootNamespace>cryptlib</RootNamespace>
|
<RootNamespace>cryptlib</RootNamespace>
|
||||||
<PlatformToolset>v100</PlatformToolset>
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
|
@ -50,7 +50,6 @@
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<!-- End of Visual Studio boilerplate -->
|
<!-- End of Visual Studio boilerplate -->
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<PropertyGroup Label="All Configurations">
|
<PropertyGroup Label="All Configurations">
|
||||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||||
|
|
@ -60,7 +59,6 @@
|
||||||
<CharacterSet>MultiByte</CharacterSet>
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Intermediate and Output directories -->
|
<!-- Intermediate and Output directories -->
|
||||||
<!-- Cryptlib and Cryptest need extra care due to Non-DLL/DLL configs -->
|
<!-- Cryptlib and Cryptest need extra care due to Non-DLL/DLL configs -->
|
||||||
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'" Label="Non-DLL Directories">
|
<PropertyGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='Release'" Label="Non-DLL Directories">
|
||||||
|
|
@ -75,7 +73,6 @@
|
||||||
<OutDir>$(Platform)\DLL_Output\Release\</OutDir>
|
<OutDir>$(Platform)\DLL_Output\Release\</OutDir>
|
||||||
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<ItemDefinitionGroup Label="All Configurations">
|
<ItemDefinitionGroup Label="All Configurations">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -89,7 +86,6 @@
|
||||||
<ErrorReporting>NoErrorReport</ErrorReporting>
|
<ErrorReporting>NoErrorReport</ErrorReporting>
|
||||||
</Lib>
|
</Lib>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Debug Configurations -->
|
<!-- Debug Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DLL-Import Debug'" Label="Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug' Or '$(Configuration)'=='DLL-Import Debug'" Label="Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -105,7 +101,6 @@
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Release Configurations -->
|
<!-- Release Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='DLL-Import Release'" Label="Release Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release' Or '$(Configuration)'=='DLL-Import Release'" Label="Release Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -123,7 +118,6 @@
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- DLL-Import Overrides for Preprocessor -->
|
<!-- DLL-Import Overrides for Preprocessor -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='DLL-Import Debug'" Label="DLL Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -135,7 +129,6 @@
|
||||||
<PreprocessorDefinitions>NDEBUG;USE_PRECOMPILED_HEADERS;CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>NDEBUG;USE_PRECOMPILED_HEADERS;CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X86 Configurations -->
|
<!-- X86 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -146,7 +139,6 @@
|
||||||
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
||||||
</Lib>
|
</Lib>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X64 Configurations -->
|
<!-- X64 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -156,9 +148,7 @@
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
</Lib>
|
</Lib>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Original File with special treatment -->
|
<!-- Original File with special treatment -->
|
||||||
|
|
||||||
<!-- Source Files -->
|
<!-- Source Files -->
|
||||||
<!-- The order of the first three matters -->
|
<!-- The order of the first three matters -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
|
@ -21,20 +21,17 @@
|
||||||
<PropertyGroup Label="Globals">
|
<PropertyGroup Label="Globals">
|
||||||
<ProjectGuid>{1974a53a-9863-41c9-886d-b2b8c2fc3c8b}</ProjectGuid>
|
<ProjectGuid>{1974a53a-9863-41c9-886d-b2b8c2fc3c8b}</ProjectGuid>
|
||||||
<RootNamespace>dlltest</RootNamespace>
|
<RootNamespace>dlltest</RootNamespace>
|
||||||
<PlatformToolset>v100</PlatformToolset>
|
<PlatformToolset>v110</PlatformToolset>
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
|
||||||
<ImportGroup Label="ExtensionSettings" />
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
<ImportGroup Label="PropertySheets">
|
<ImportGroup Label="PropertySheets">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<!-- End of Visual Studio boilerplate -->
|
<!-- End of Visual Studio boilerplate -->
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<PropertyGroup Label="All Configurations">
|
<PropertyGroup Label="All Configurations">
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
|
@ -44,7 +41,6 @@
|
||||||
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
|
<OutDir>$(Platform)\DLL_Output\$(Configuration)\</OutDir>
|
||||||
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
<IntDir>$(Platform)\$(ProjectName)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- All Configurations -->
|
<!-- All Configurations -->
|
||||||
<ItemDefinitionGroup Label="All Configurations">
|
<ItemDefinitionGroup Label="All Configurations">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -61,7 +57,6 @@
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Debug Configurations -->
|
<!-- Debug Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'" Label="Debug Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -77,7 +72,6 @@
|
||||||
<Culture>0x0409</Culture>
|
<Culture>0x0409</Culture>
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Release Configurations -->
|
<!-- Release Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
|
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'" Label="Release Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -99,7 +93,6 @@
|
||||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X86 Configurations -->
|
<!-- X86 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='Win32'" Label="X86 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -110,7 +103,6 @@
|
||||||
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
<ImageHasSafeExceptionHandlers>true</ImageHasSafeExceptionHandlers>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- X64 Configurations -->
|
<!-- X64 Configurations -->
|
||||||
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'" Label="X64 Configuration">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
|
|
@ -120,14 +112,12 @@
|
||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
<!-- Source Files -->
|
<!-- Source Files -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="dlltest.cpp" />
|
<ClCompile Include="dlltest.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- Back to Visual Studio boilerplate -->
|
<!-- Back to Visual Studio boilerplate -->
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
||||||
168
kalyna.cpp
168
kalyna.cpp
|
|
@ -929,20 +929,16 @@ void Kalyna::Base::SetKey_88(const word64 key[8])
|
||||||
|
|
||||||
// *********************** ProcessAndXorBlock specializations *********************** //
|
// *********************** ProcessAndXorBlock specializations *********************** //
|
||||||
|
|
||||||
void Kalyna::Base::ProcessBlock_22(const word64 inBlock[2], word64 outBlock[2]) const
|
void Kalyna::Base::ProcessBlock_22(const word64 inBlock[2], const word64 xorBlock[2], word64 outBlock[2]) const
|
||||||
{
|
{
|
||||||
#if defined(IS_BIG_ENDIAN)
|
|
||||||
word64 *t1 = m_wspace+0, *t2 = m_wspace+2, *msg = m_wspace+4;
|
word64 *t1 = m_wspace+0, *t2 = m_wspace+2, *msg = m_wspace+4;
|
||||||
{
|
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
|
||||||
Block block(inBlock);
|
|
||||||
block(msg[0])(msg[1]);
|
|
||||||
inBlock = msg;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
word64 *t1 = outBlock, *t2 = m_wspace+2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
|
typedef GetBlock<word64, LittleEndian, false> InBlock;
|
||||||
|
InBlock iblk(inBlock);
|
||||||
|
iblk(msg[0])(msg[1]);
|
||||||
|
|
||||||
|
inBlock = msg;
|
||||||
if (IsForwardTransformation())
|
if (IsForwardTransformation())
|
||||||
{
|
{
|
||||||
AddKey<2>(inBlock, t1, m_rkeys);
|
AddKey<2>(inBlock, t1, m_rkeys);
|
||||||
|
|
@ -973,29 +969,22 @@ void Kalyna::Base::ProcessBlock_22(const word64 inBlock[2], word64 outBlock[2])
|
||||||
IGL128(t2, t1, &m_rkeys[0]);
|
IGL128(t2, t1, &m_rkeys[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_BIG_ENDIAN)
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
{
|
typedef PutBlock<word64, LittleEndian, false> OutBlock;
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
OutBlock oblk(xorBlock, outBlock);
|
||||||
Block block(t1);
|
oblk(t1[0])(t1[1]);
|
||||||
block(outBlock[0])(outBlock[1]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kalyna::Base::ProcessBlock_24(const word64 inBlock[2], word64 outBlock[2]) const
|
void Kalyna::Base::ProcessBlock_24(const word64 inBlock[2], const word64 xorBlock[2], word64 outBlock[2]) const
|
||||||
{
|
{
|
||||||
#if defined(IS_BIG_ENDIAN)
|
|
||||||
word64 *t1 = m_wspace+0, *t2 = m_wspace+2, *msg = m_wspace+4;
|
word64 *t1 = m_wspace+0, *t2 = m_wspace+2, *msg = m_wspace+4;
|
||||||
{
|
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
|
||||||
Block block(inBlock);
|
|
||||||
block(msg[0])(msg[1]);
|
|
||||||
inBlock = msg;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
word64 *t1 = outBlock, *t2 = m_wspace+2;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
|
typedef GetBlock<word64, LittleEndian, false> InBlock;
|
||||||
|
InBlock iblk(inBlock);
|
||||||
|
iblk(msg[0])(msg[1]);
|
||||||
|
|
||||||
|
inBlock = msg;
|
||||||
if (IsForwardTransformation())
|
if (IsForwardTransformation())
|
||||||
{
|
{
|
||||||
AddKey<2>(inBlock, t1, m_rkeys);
|
AddKey<2>(inBlock, t1, m_rkeys);
|
||||||
|
|
@ -1034,29 +1023,22 @@ void Kalyna::Base::ProcessBlock_24(const word64 inBlock[2], word64 outBlock[2])
|
||||||
IGL128(t2, t1, &m_rkeys[0]);
|
IGL128(t2, t1, &m_rkeys[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_BIG_ENDIAN)
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
{
|
typedef PutBlock<word64, LittleEndian, false> OutBlock;
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
OutBlock oblk(xorBlock, outBlock);
|
||||||
Block block(t1);
|
oblk(t1[0])(t1[1]);
|
||||||
block(outBlock[0])(outBlock[1]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kalyna::Base::ProcessBlock_44(const word64 inBlock[4], word64 outBlock[4]) const
|
void Kalyna::Base::ProcessBlock_44(const word64 inBlock[4], const word64 xorBlock[4], word64 outBlock[4]) const
|
||||||
{
|
{
|
||||||
#if defined(IS_BIG_ENDIAN)
|
|
||||||
word64 *t1 = m_wspace+0, *t2 = m_wspace+4, *msg = m_wspace+8;
|
word64 *t1 = m_wspace+0, *t2 = m_wspace+4, *msg = m_wspace+8;
|
||||||
{
|
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
|
||||||
Block block(inBlock);
|
|
||||||
block(msg[0])(msg[1])(msg[2])(msg[3]);
|
|
||||||
inBlock = msg;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
word64 *t1 = outBlock, *t2 = m_wspace+4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
|
typedef GetBlock<word64, LittleEndian, false> InBlock;
|
||||||
|
InBlock iblk(inBlock);
|
||||||
|
iblk(msg[0])(msg[1])(msg[2])(msg[3]);
|
||||||
|
|
||||||
|
inBlock = msg;
|
||||||
if (IsForwardTransformation())
|
if (IsForwardTransformation())
|
||||||
{
|
{
|
||||||
AddKey<4>(inBlock, t1, m_rkeys);
|
AddKey<4>(inBlock, t1, m_rkeys);
|
||||||
|
|
@ -1095,32 +1077,25 @@ void Kalyna::Base::ProcessBlock_44(const word64 inBlock[4], word64 outBlock[4])
|
||||||
IGL256(t2, t1, &m_rkeys[0]);
|
IGL256(t2, t1, &m_rkeys[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_BIG_ENDIAN)
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
{
|
typedef PutBlock<word64, LittleEndian, false> OutBlock;
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
OutBlock oblk(xorBlock, outBlock);
|
||||||
Block block(t1);
|
oblk(t1[0])(t1[1])(t1[2])(t1[3]);
|
||||||
block(outBlock[0])(outBlock[1])(outBlock[2])(outBlock[3]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kalyna::Base::ProcessBlock_48(const word64 inBlock[4], word64 outBlock[4]) const
|
void Kalyna::Base::ProcessBlock_48(const word64 inBlock[4], const word64 xorBlock[4], word64 outBlock[4]) const
|
||||||
{
|
{
|
||||||
#if defined(IS_BIG_ENDIAN)
|
|
||||||
word64 *t1 = m_wspace+0, *t2 = m_wspace+4, *msg = m_wspace+8;
|
word64 *t1 = m_wspace+0, *t2 = m_wspace+4, *msg = m_wspace+8;
|
||||||
{
|
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
|
||||||
Block block(inBlock);
|
|
||||||
block(msg[0])(msg[1])(msg[2])(msg[3]);
|
|
||||||
inBlock = msg;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
word64 *t1 = outBlock, *t2 = m_wspace+4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
|
typedef GetBlock<word64, LittleEndian, false> InBlock;
|
||||||
|
InBlock iblk(inBlock);
|
||||||
|
iblk(msg[0])(msg[1])(msg[2])(msg[3]);
|
||||||
|
|
||||||
|
inBlock = msg;
|
||||||
if (IsForwardTransformation())
|
if (IsForwardTransformation())
|
||||||
{
|
{
|
||||||
AddKey<4>((const word64*)inBlock, t1, m_rkeys);
|
AddKey<4>(inBlock, t1, m_rkeys);
|
||||||
G256(t1, t2, &m_rkeys[4]); // 1
|
G256(t1, t2, &m_rkeys[4]); // 1
|
||||||
G256(t2, t1, &m_rkeys[8]); // 2
|
G256(t2, t1, &m_rkeys[8]); // 2
|
||||||
G256(t1, t2, &m_rkeys[12]); // 3
|
G256(t1, t2, &m_rkeys[12]); // 3
|
||||||
|
|
@ -1164,29 +1139,22 @@ void Kalyna::Base::ProcessBlock_48(const word64 inBlock[4], word64 outBlock[4])
|
||||||
IGL256(t2, t1, &m_rkeys[0]);
|
IGL256(t2, t1, &m_rkeys[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_BIG_ENDIAN)
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
{
|
typedef PutBlock<word64, LittleEndian, false> OutBlock;
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
OutBlock oblk(xorBlock, outBlock);
|
||||||
Block block(t1);
|
oblk(t1[0])(t1[1])(t1[2])(t1[3]);
|
||||||
block(outBlock[0])(outBlock[1])(outBlock[2])(outBlock[3]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Kalyna::Base::ProcessBlock_88(const word64 inBlock[8], word64 outBlock[8]) const
|
void Kalyna::Base::ProcessBlock_88(const word64 inBlock[8], const word64 xorBlock[8], word64 outBlock[8]) const
|
||||||
{
|
{
|
||||||
#if defined(IS_BIG_ENDIAN)
|
|
||||||
word64 *t1 = m_wspace+0, *t2 = m_wspace+8, *msg = m_wspace+16;
|
word64 *t1 = m_wspace+0, *t2 = m_wspace+8, *msg = m_wspace+16;
|
||||||
{
|
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
|
||||||
Block block(inBlock);
|
|
||||||
block(msg[0])(msg[1])(msg[2])(msg[3])(msg[4])(msg[5])(msg[6])(msg[7]);
|
|
||||||
inBlock = msg;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
word64 *t1 = outBlock, *t2 = m_wspace+8;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
|
typedef GetBlock<word64, LittleEndian, false> InBlock;
|
||||||
|
InBlock iblk(inBlock);
|
||||||
|
iblk(msg[0])(msg[1])(msg[2])(msg[3])(msg[4])(msg[5])(msg[6])(msg[7]);
|
||||||
|
|
||||||
|
inBlock = msg;
|
||||||
if (IsForwardTransformation())
|
if (IsForwardTransformation())
|
||||||
{
|
{
|
||||||
AddKey<8>(inBlock, t1, m_rkeys);
|
AddKey<8>(inBlock, t1, m_rkeys);
|
||||||
|
|
@ -1233,14 +1201,10 @@ void Kalyna::Base::ProcessBlock_88(const word64 inBlock[8], word64 outBlock[8])
|
||||||
IGL512(t2, t1, &m_rkeys[0]);
|
IGL512(t2, t1, &m_rkeys[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(IS_BIG_ENDIAN)
|
// Reverse bytes on BigEndian; Align pointer on LittleEndian
|
||||||
{
|
typedef PutBlock<word64, LittleEndian, false> OutBlock;
|
||||||
typedef GetBlock<word64, LittleEndian, false> Block;
|
OutBlock oblk(xorBlock, outBlock);
|
||||||
Block block(t1);
|
oblk(t1[0])(t1[1])(t1[2])(t1[3])(t1[4])(t1[5])(t1[6])(t1[7]);
|
||||||
block(outBlock[0])(outBlock[1])(outBlock[2])(outBlock[3])
|
|
||||||
(outBlock[4])(outBlock[5])(outBlock[6])(outBlock[7]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// *********************** Library routines *********************** //
|
// *********************** Library routines *********************** //
|
||||||
|
|
@ -1324,32 +1288,34 @@ void Kalyna::Base::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock,
|
||||||
|
|
||||||
const byte* p = reinterpret_cast<const byte*>(KalynaTab::S);
|
const byte* p = reinterpret_cast<const byte*>(KalynaTab::S);
|
||||||
for (unsigned int i=0; i<256; i+=cacheLineSize)
|
for (unsigned int i=0; i<256; i+=cacheLineSize)
|
||||||
u &= *reinterpret_cast<const word64*>(p+i);
|
u ^= *reinterpret_cast<const word64*>(p+i);
|
||||||
m_wspace[0] = u;
|
m_wspace[0] = u;
|
||||||
|
|
||||||
switch ((m_nb << 8) | m_nk)
|
switch ((m_nb << 8) | m_nk)
|
||||||
{
|
{
|
||||||
case (2 << 8) | 2:
|
case (2 << 8) | 2:
|
||||||
ProcessBlock_22(reinterpret_cast<const word64*>(inBlock), reinterpret_cast<word64*>(outBlock));
|
ProcessBlock_22(reinterpret_cast<const word64*>(inBlock),
|
||||||
|
reinterpret_cast<const word64*>(xorBlock), reinterpret_cast<word64*>(outBlock));
|
||||||
break;
|
break;
|
||||||
case (2 << 8) | 4:
|
case (2 << 8) | 4:
|
||||||
ProcessBlock_24(reinterpret_cast<const word64*>(inBlock), reinterpret_cast<word64*>(outBlock));
|
ProcessBlock_24(reinterpret_cast<const word64*>(inBlock),
|
||||||
|
reinterpret_cast<const word64*>(xorBlock), reinterpret_cast<word64*>(outBlock));
|
||||||
break;
|
break;
|
||||||
case (4 << 8) | 4:
|
case (4 << 8) | 4:
|
||||||
ProcessBlock_44(reinterpret_cast<const word64*>(inBlock), reinterpret_cast<word64*>(outBlock));
|
ProcessBlock_44(reinterpret_cast<const word64*>(inBlock),
|
||||||
|
reinterpret_cast<const word64*>(xorBlock), reinterpret_cast<word64*>(outBlock));
|
||||||
break;
|
break;
|
||||||
case (4 << 8) | 8:
|
case (4 << 8) | 8:
|
||||||
ProcessBlock_48(reinterpret_cast<const word64*>(inBlock), reinterpret_cast<word64*>(outBlock));
|
ProcessBlock_48(reinterpret_cast<const word64*>(inBlock),
|
||||||
|
reinterpret_cast<const word64*>(xorBlock), reinterpret_cast<word64*>(outBlock));
|
||||||
break;
|
break;
|
||||||
case (8 << 8) | 8:
|
case (8 << 8) | 8:
|
||||||
ProcessBlock_88(reinterpret_cast<const word64*>(inBlock), reinterpret_cast<word64*>(outBlock));
|
ProcessBlock_88(reinterpret_cast<const word64*>(inBlock),
|
||||||
|
reinterpret_cast<const word64*>(xorBlock), reinterpret_cast<word64*>(outBlock));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CRYPTOPP_ASSERT(0);
|
CRYPTOPP_ASSERT(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i=0; xorBlock && i<m_nb; ++i)
|
|
||||||
outBlock[i] ^= xorBlock[i];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NAMESPACE_END
|
NAMESPACE_END
|
||||||
|
|
|
||||||
10
kalyna.h
10
kalyna.h
|
|
@ -134,11 +134,11 @@ public:
|
||||||
// Visual Studio and C2910: 'Kalyna::Base::ProcessBlock_Template': cannot be explicitly specialized
|
// Visual Studio and C2910: 'Kalyna::Base::ProcessBlock_Template': cannot be explicitly specialized
|
||||||
//template <unsigned int NB, unsigned int NK>
|
//template <unsigned int NB, unsigned int NK>
|
||||||
// void ProcessBlock_Template(const word64 inBlock[NB], const word64 outBlock[NB]) const;
|
// void ProcessBlock_Template(const word64 inBlock[NB], const word64 outBlock[NB]) const;
|
||||||
void ProcessBlock_22(const word64 inBlock[2], word64 outBlock[2]) const;
|
void ProcessBlock_22(const word64 inBlock[2], const word64 xorBlock[2], word64 outBlock[2]) const;
|
||||||
void ProcessBlock_24(const word64 inBlock[2], word64 outBlock[2]) const;
|
void ProcessBlock_24(const word64 inBlock[2], const word64 xorBlock[2] ,word64 outBlock[2]) const;
|
||||||
void ProcessBlock_44(const word64 inBlock[4], word64 outBlock[4]) const;
|
void ProcessBlock_44(const word64 inBlock[4], const word64 xorBlock[4], word64 outBlock[4]) const;
|
||||||
void ProcessBlock_48(const word64 inBlock[4], word64 outBlock[4]) const;
|
void ProcessBlock_48(const word64 inBlock[4], const word64 xorBlock[4], word64 outBlock[4]) const;
|
||||||
void ProcessBlock_88(const word64 inBlock[8], word64 outBlock[8]) const;
|
void ProcessBlock_88(const word64 inBlock[8], const word64 xorBlock[8], word64 outBlock[8]) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef SecBlock<word64, AllocatorWithCleanup<word64, true> > AlignedSecBlock64;
|
typedef SecBlock<word64, AllocatorWithCleanup<word64, true> > AlignedSecBlock64;
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ void RegisterFactories2()
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<SEED> >();
|
||||||
RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
|
RegisterSymmetricCipherDefaultFactories<CTR_Mode<SEED> >();
|
||||||
RegisterSymmetricCipherDefaultFactories<ECB_Mode<Kalyna> >(); // Test Vectors
|
RegisterSymmetricCipherDefaultFactories<ECB_Mode<Kalyna> >(); // Test Vectors
|
||||||
|
RegisterSymmetricCipherDefaultFactories<CBC_Mode<Kalyna> >(); // Test Vectors
|
||||||
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Kalyna> >(); // Benchmarks
|
RegisterSymmetricCipherDefaultFactories<CTR_Mode<Kalyna> >(); // Benchmarks
|
||||||
|
|
||||||
RegisterDefaultFactoryFor<KeyDerivationFunction, HKDF<SHA1> >();
|
RegisterDefaultFactoryFor<KeyDerivationFunction, HKDF<SHA1> >();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue