Skip to content

Commit

Permalink
Minor clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
kimlaine committed Nov 28, 2019
1 parent 410611f commit b2759db
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 73 deletions.
2 changes: 1 addition & 1 deletion dotnet/examples/3_Levels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ special prime +---------+
In this example the PlainModulus does not play much of a role; we choose
some reasonable value.
*/
parms.PlainModulus = PlainModulus.Batching(polyModulusDegree, 20);//new SmallModulus(1 << 20);
parms.PlainModulus = PlainModulus.Batching(polyModulusDegree, 20);

SEALContext context = new SEALContext(parms);
Utilities.PrintParameters(context);
Expand Down
62 changes: 31 additions & 31 deletions dotnet/examples/SEALNetExamples.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Authors>Microsoft Research</Authors>
<Company>Microsoft Corporation</Company>
<Description>.NET wrapper examples for Microsoft SEAL</Description>
<Copyright>Microsoft Corporation 2019</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Platform)'=='AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>../bin/$(Configuration)</OutputPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../src/SEALNet.csproj" />
</ItemGroup>

<ItemGroup>
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="$(ProjectDir)../lib/x64/$(Configuration)/sealnetnative.dll" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Linux))" Include="$(ProjectDir)../lib/libsealnetnative.so.*" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(OSX))" Include="$(ProjectDir)../lib/libsealnetnative.*.dylib" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(SEALNetNativeBinaryFiles)" DestinationFolder="$(TargetDir)" />
</Target>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<Authors>Microsoft Research</Authors>
<Company>Microsoft Corporation</Company>
<Description>.NET wrapper examples for Microsoft SEAL</Description>
<Copyright>Microsoft Corporation 2019</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Platform)'=='AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>../bin/$(Configuration)</OutputPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="../src/SEALNet.csproj" />
</ItemGroup>

<ItemGroup>
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="$(ProjectDir)../lib/x64/$(Configuration)/sealnetnative.dll" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Linux))" Include="$(ProjectDir)../lib/libsealnetnative.so.*" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(OSX))" Include="$(ProjectDir)../lib/libsealnetnative.*.dylib" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(SEALNetNativeBinaryFiles)" DestinationFolder="$(TargetDir)" />
</Target>

</Project>
74 changes: 37 additions & 37 deletions dotnet/tests/SEALNetTest.csproj
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
<Authors>Microsoft Research</Authors>
<Company>Microsoft Corporation</Company>
<Description>.NET wrapper unit tests for Microsoft SEAL</Description>
<Copyright>Microsoft Corporation 2019</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Platform)'=='AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>../lib/$(Configuration)</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../src/SEALNet.csproj" />
</ItemGroup>

<ItemGroup>
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="$(ProjectDir)../lib/x64/$(Configuration)/sealnetnative.dll" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Linux))" Include="$(ProjectDir)../lib/libsealnetnative.so.*" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(OSX))" Include="$(ProjectDir)../lib/libsealnetnative*.dylib" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(SEALNetNativeBinaryFiles)" DestinationFolder="$(TargetDir)" />
</Target>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
<Authors>Microsoft Research</Authors>
<Company>Microsoft Corporation</Company>
<Description>.NET wrapper unit tests for Microsoft SEAL</Description>
<Copyright>Microsoft Corporation 2019</Copyright>
</PropertyGroup>

<PropertyGroup Condition="'$(Platform)'=='AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<OutputPath>../lib/$(Configuration)</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.0.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="../src/SEALNet.csproj" />
</ItemGroup>

<ItemGroup>
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Windows))" Include="$(ProjectDir)../lib/x64/$(Configuration)/sealnetnative.dll" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(Linux))" Include="$(ProjectDir)../lib/libsealnetnative.so.*" />
<SEALNetNativeBinaryFiles Condition="$([MSBuild]::IsOsPlatform(OSX))" Include="$(ProjectDir)../lib/libsealnetnative*.dylib" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Copy SourceFiles="@(SEALNetNativeBinaryFiles)" DestinationFolder="$(TargetDir)" />
</Target>

</Project>
4 changes: 0 additions & 4 deletions native/src/seal/evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1868,10 +1868,6 @@ namespace seal
{
throw invalid_argument("plain is not valid for encryption parameters");
}
if (!context_->get_context_data(encrypted.parms_id()))
{
throw invalid_argument("encrypted is not valid for encryption parameters");
}
if (encrypted.is_ntt_form() != plain.is_ntt_form())
{
throw invalid_argument("NTT form mismatch");
Expand Down

0 comments on commit b2759db

Please sign in to comment.