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