Skip to content

Commit 265d77e

Browse files
author
Wei Dai
committed
Version 3.7.3.
1 parent 354c6ba commit 265d77e

File tree

10 files changed

+74
-67
lines changed

10 files changed

+74
-67
lines changed

CHANGES.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
- All output files including downloaded thirdparty dependencies and Visual Studio project and solution files will be created in the build directory [(PR 427)](https://github.com/microsoft/SEAL/pull/427).
88
- Reduced `util::try_minimal_primitive_root` search iterations by half [(PR 430)](https://github.com/microsoft/SEAL/pull/430). Thanks, [zirconium-n](https://github.com/zirconium-n)!
99
- Updated .Net SDK version to 6.0.x and supported Visual Studio version to 17 2022.
10+
- Added `SEAL_AVOID_BRANCHING` option to eleminate branching in critical functions when Microsoft SEAL is built with maliciously inserted compiler flags.
1011

11-
## Bug Fixes
12+
### Bug Fixes
1213

1314
- Removed exceptions in `KeyGenerator::CreateGaloisKeys` when inputs do not include steps so that even when `EncryptionParameterQualifiers::using_batching` is false Galois automorphisms are still available.
1415

15-
## File Changes
16+
### File Changes
1617

1718
- `dotnet/SEALNet.sln` is removed.
1819
- `dotnet/SEALNet.sln.in` is added.

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if(NOT CMAKE_BUILD_TYPE)
2323
endif()
2424
message(STATUS "Build type (CMAKE_BUILD_TYPE): ${CMAKE_BUILD_TYPE}")
2525

26-
project(SEAL VERSION 3.7.2 LANGUAGES CXX C)
26+
project(SEAL VERSION 3.7.3 LANGUAGES CXX C)
2727

2828
########################
2929
# Global configuration #
@@ -266,7 +266,7 @@ set_property(CACHE SEAL_DEFAULT_PRNG PROPERTY
266266
mark_as_advanced(FORCE SEAL_DEFAULT_PRNG)
267267

268268
# [option] SEAL_AVOID_BRANCHING (default: OFF)
269-
# Avoid branching in conditional move operations if set to ON, use faster method if set to OFF.
269+
# Avoid branching in critical conditional move operations if set to ON, use faster method if set to OFF.
270270
set(SEAL_AVOID_BRANCHING_STR "Use an always branching-free conditional move")
271271
option(SEAL_AVOID_BRANCHING ${SEAL_AVOID_BRANCHING_STR} OFF)
272272
message(STATUS "SEAL_AVOID_BRANCHING: ${SEAL_AVOID_BRANCHING}")

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ The following options can be used with CMake to further configure the build. Mos
430430
| SEAL_BUILD_STATIC_SEAL_C | ON / **OFF** | Set to `ON` to build SEAL_C as a static library instead of a shared library. |
431431
| SEAL_DEFAULT_PRNG | **Blake2xb**</br>Shake256 | Microsoft SEAL supports both Blake2xb and Shake256 XOFs for generating random bytes. Blake2xb is much faster, but it is not standardized, whereas Shake256 is a FIPS standard. |
432432
| SEAL_USE_GAUSSIAN_NOISE | ON / **OFF** | Set to `ON` to use a non-constant time rounded continuous Gaussian for the error distribution; otherwise a centered binomial distribution &ndash; with slightly larger standard deviation &ndash; is used. |
433+
| SEAL_AVOID_BRANCHING | ON / **OFF** | Set to `ON` to eliminate branching in critical conditional move operations when compiler has maliciously inserted flags; otherwise assume `cmov` is used. |
433434
| SEAL_SECURE_COMPILE_OPTIONS | ON / **OFF** | Set to `ON` to compile/link with Control-Flow Guard (`/guard:cf`) and Spectre mitigations (`/Qspectre`). This has an effect only when compiling with MSVC. |
434435
| SEAL_USE_ALIGNED_ALLOC | **ON** / OFF | Set to `ON` to use 64-byte aligned memory allocations. This can improve performance of AVX512 primitives when Intel HEXL is enabled. This depends on C++17 and is disabled on Android. |
435436

cmake/SEALConfig.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
# validation code (little impact on performance)
2828
# SEAL_USE_GAUSSIAN_NOISE : Set to non-zero value if library is compiled to sample noise from a rounded Gaussian
2929
# distribution (slower) instead of a centered binomial distribution (faster)
30+
# SEAL_AVOID_BRANCHING : Set to non-zero value if library is compiled to eliminate branching in critical conditional move operations.
3031
# SEAL_DEFAULT_PRNG : The default choice of PRNG (e.g., "Blake2xb" or "Shake256")
3132
#
3233
# SEAL_USE_MSGSL : Set to non-zero value if library is compiled with Microsoft GSL support
@@ -70,6 +71,7 @@ set(SEAL_USE_NODISCARD @SEAL_USE_NODISCARD@)
7071

7172
set(SEAL_THROW_ON_TRANSPARENT_CIPHERTEXT @SEAL_THROW_ON_TRANSPARENT_CIPHERTEXT@)
7273
set(SEAL_USE_GAUSSIAN_NOISE @SEAL_USE_GAUSSIAN_NOISE@)
74+
set(SEAL_AVOID_BRANCHING @SEAL_AVOID_BRANCHING@)
7375
set(SEAL_DEFAULT_PRNG @SEAL_DEFAULT_PRNG@)
7476

7577
set(SEAL_USE_MSGSL @SEAL_USE_MSGSL@)

dotnet/tests/SEALNetTest.csproj.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</PropertyGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
18+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
1919
<PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
2020
<PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
2121
</ItemGroup>

native/bench/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
cmake_minimum_required(VERSION 3.13)
55

6-
project(SEALBench VERSION 3.7.2 LANGUAGES CXX)
6+
project(SEALBench VERSION 3.7.3 LANGUAGES CXX)
77

88
# If not called from root CMakeLists.txt
99
if(NOT DEFINED SEAL_BUILD_BENCH)
1010
set(SEAL_BUILD_BENCH ON)
1111

1212
# Import Microsoft SEAL
13-
find_package(SEAL 3.7.2 EXACT REQUIRED)
13+
find_package(SEAL 3.7.3 EXACT REQUIRED)
1414

1515
# Must define these variables and include macros
1616
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})

native/examples/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
cmake_minimum_required(VERSION 3.13)
55

6-
project(SEALExamples VERSION 3.7.2 LANGUAGES CXX)
6+
project(SEALExamples VERSION 3.7.3 LANGUAGES CXX)
77

88
# If not called from root CMakeLists.txt
99
if(NOT DEFINED SEAL_BUILD_EXAMPLES)
1010
set(SEAL_BUILD_EXAMPLES ON)
1111

1212
# Import Microsoft SEAL
13-
find_package(SEAL 3.7.2 EXACT REQUIRED)
13+
find_package(SEAL 3.7.3 EXACT REQUIRED)
1414

1515
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
1616
endif()

native/tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
cmake_minimum_required(VERSION 3.13)
55

6-
project(SEALTest VERSION 3.7.2 LANGUAGES CXX C)
6+
project(SEALTest VERSION 3.7.3 LANGUAGES CXX C)
77

88
# If not called from root CMakeLists.txt
99
if(NOT DEFINED SEAL_BUILD_TESTS)
1010
set(SEAL_BUILD_TESTS ON)
1111

1212
# Import Microsoft SEAL
13-
find_package(SEAL 3.7.2 EXACT REQUIRED)
13+
find_package(SEAL 3.7.3 EXACT REQUIRED)
1414

1515
# Must define these variables and include macros
1616
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})

pipelines/jobs.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
${{ if eq(parameters.debug, 'false') }}:
1212
timeoutInMinutes: 0
1313
pool:
14-
vmImage: 'windows-latest'
14+
vmImage: 'windows-2022'
1515
steps:
1616
- template: windows.yml
1717
parameters:
18-
nuget_version: '5.4.0'
18+
nuget_version: '6.1.0'
1919
${{ if eq(parameters.debug, 'true') }}:
2020
configuration: 'Debug'
2121
${{ if eq(parameters.debug, 'false') }}:
@@ -67,7 +67,7 @@ jobs:
6767
- job: ${{ parameters.name }}
6868
displayName: ${{ parameters.name }}
6969
pool:
70-
vmImage: 'windows-latest'
70+
vmImage: 'windows-2022'
7171
steps:
7272
- template: android.yml
7373
parameters:
@@ -82,8 +82,8 @@ jobs:
8282
displayName: ${{ parameters.name }}
8383
dependsOn: [Windows, Linux, macOS, Android]
8484
pool:
85-
vmImage: 'windows-latest'
85+
vmImage: 'windows-2022'
8686
steps:
8787
- template: nuget.yml
8888
parameters:
89-
nuget_version: '5.4.0'
89+
nuget_version: '6.1.0'

pipelines/windows.yml

Lines changed: 54 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
steps:
2+
- task: CMake@1
3+
displayName: 'Configure SEAL'
4+
inputs:
5+
cmakeArgs: .. -DCMAKE_BUILD_TYPE='${{ parameters.configuration }}' -DSEAL_BUILD_DEPS=ON -DSEAL_BUILD_TESTS=ON -DSEAL_BUILD_EXAMPLES=ON -DSEAL_BUILD_SEAL_C=ON -DSEAL_SECURE_COMPILE_OPTIONS=ON
6+
workingDirectory: '$(Build.SourcesDirectory)/build'
7+
8+
- task: MSBuild@1
9+
displayName: 'Build SEAL'
10+
inputs:
11+
solution: '$(Build.SourcesDirectory)/build/seal.sln'
12+
msbuildArchitecture: 'x64'
13+
platform: 'x64'
14+
configuration: '${{ parameters.configuration }}'
15+
msbuildVersion: 'latest'
16+
17+
- task: VSTest@2
18+
displayName: 'VsTest - native tests'
19+
inputs:
20+
testAssemblyVer2: |
21+
**\${{ parameters.configuration }}\*test*.dll
22+
**\${{ parameters.configuration }}\*test*.exe
23+
!**\obj\**
24+
platform: 'x64'
25+
configuration: ${{ parameters.configuration }}
26+
diagnosticsEnabled: True
27+
228
- task: NuGetToolInstaller@1
329
displayName: 'Use NuGet'
430
inputs:
@@ -10,18 +36,21 @@ steps:
1036
restoreSolution: tools/config/packages.config
1137
restoreDirectory: ConfigPackages
1238

39+
- task: UseDotNet@2
40+
displayName: 'Get .NET Core 6.0 SDK'
41+
inputs:
42+
packageType: 'sdk'
43+
version: '6.0.x'
44+
1345
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
1446
displayName: 'Run CredScan'
1547
inputs:
1648
toolMajorVersion: 'V2'
1749
outputFormat: sarif
1850
debugMode: false
1951

20-
- task: UseDotNet@2
21-
displayName: 'Get .NET Core 6.0 SDK'
22-
inputs:
23-
packageType: 'sdk'
24-
version: '6.0.x'
52+
- task: securedevelopmentteam.vss-secure-development-tools.build-task-roslynanalyzers.RoslynAnalyzers@2
53+
displayName: 'Run Roslyn Analyzers'
2554

2655
- ${{ if eq(parameters.configuration, 'Release') }}:
2756
- task: PowerShell@2
@@ -30,75 +59,39 @@ steps:
3059
targetType: 'inline'
3160
script: |
3261
# Get signing certificate
33-
$CertOutFile = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath dotnet\src\SEALNetCert.snk
62+
$CertOutFile = Join-Path -Path $env:BUILD_SOURCESDIRECTORY -ChildPath build\dotnet\src\SEALNetCert.snk
3463
if (Test-Path env:SEALNetSigningCertificate) {
3564
Invoke-WebRequest -Uri "$env:SEALNetSigningCertificate" -OutFile $CertOutFile
3665
}
3766
38-
- task: CMake@1
39-
displayName: 'Configure SEAL'
40-
inputs:
41-
cmakeArgs: .. -DCMAKE_BUILD_TYPE='${{ parameters.configuration }}' -DSEAL_BUILD_DEPS=ON -DSEAL_BUILD_TESTS=ON -DSEAL_BUILD_EXAMPLES=ON -DSEAL_BUILD_SEAL_C=ON -DSEAL_SECURE_COMPILE_OPTIONS=ON
42-
workingDirectory: '$(Build.SourcesDirectory)/build'
43-
44-
- task: MSBuild@1
45-
displayName: 'Build SEAL'
46-
inputs:
47-
solution: '$(Build.SourcesDirectory)/build/seal.sln'
48-
msbuildArchitecture: 'x64'
49-
platform: 'x64'
50-
configuration: '${{ parameters.configuration }}'
51-
52-
- task: securedevelopmentteam.vss-secure-development-tools.build-task-roslynanalyzers.RoslynAnalyzers@2
53-
displayName: 'Run Roslyn Analyzers'
54-
55-
- task: VSTest@2
56-
displayName: 'VsTest - native tests'
57-
inputs:
58-
testAssemblyVer2: |
59-
**\${{ parameters.configuration }}\*test*.dll
60-
**\${{ parameters.configuration }}\*test*.exe
61-
!**\obj\**
62-
platform: 'x64'
63-
configuration: ${{ parameters.configuration }}
64-
diagnosticsEnabled: True
65-
6667
- task: NuGetCommand@2
6768
displayName: 'NuGet restore from Solution'
6869
inputs:
6970
command: 'restore'
70-
restoreSolution: 'dotnet/SEALNet.sln'
71+
restoreSolution: '$(Build.SourcesDirectory)/build/dotnet/SEALNet.sln'
7172
feedsToUse: 'select'
7273

7374
- task: MSBuild@1
7475
displayName: 'Build SEALNet'
7576
inputs:
76-
solution: '$(Build.SourcesDirectory)/dotnet/SEALNet.sln'
77+
solution: '$(Build.SourcesDirectory)/build/dotnet/SEALNet.sln'
7778
msbuildArchitecture: 'x64'
7879
platform: 'x64'
7980
configuration: '${{ parameters.configuration }}'
80-
81-
- ${{ if eq(parameters.configuration, 'Release') }}:
82-
- task: MSBuild@1
83-
displayName: 'Build SEALNet for iOS'
84-
inputs:
85-
solution: '$(Build.SourcesDirectory)/dotnet/src/SEALNet.csproj'
86-
msbuildArchitecture: 'x64'
87-
platform: 'x64'
88-
msbuildArguments: '/p:BuildIOS=1'
89-
configuration: '${{ parameters.configuration }}'
81+
msbuildVersion: 'latest'
9082

9183
- task: VSTest@2
9284
displayName: 'VsTest - dotnet tests'
9385
inputs:
9486
testAssemblyVer2: |
9587
**\${{ parameters.configuration }}\**\sealnettest.dll
9688
!**\obj\**
89+
!**\ref\**
9790
configuration: ${{ parameters.configuration }}
9891
diagnosticsEnabled: True
9992

10093
- ${{ if eq(parameters.configuration, 'Release') }}:
101-
- task: Semmle@0
94+
- task: Semmle@1
10295
displayName: 'Semmle SEAL'
10396
env:
10497
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
@@ -112,7 +105,7 @@ steps:
112105
buildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/build/seal.sln'
113106
cleanupBuildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/build/seal.sln /t:Clean'
114107

115-
- task: Semmle@0
108+
- task: Semmle@1
116109
displayName: 'Semmle SEALNet'
117110
env:
118111
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
@@ -123,8 +116,18 @@ steps:
123116
timeout: '1800'
124117
ram: '16384'
125118
addProjectDirToScanningExclusionList: true
126-
buildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/dotnet/SEALNet.sln'
127-
cleanupBuildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/dotnet/SEALNet.sln /t:Clean'
119+
buildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/build/dotnet/SEALNet.sln'
120+
cleanupBuildCommands: '"%ProgramFiles(x86)%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsMSBuildCmd.bat" && msbuild $(Build.SourcesDirectory)/build/dotnet/SEALNet.sln /t:Clean'
121+
122+
- task: MSBuild@1
123+
displayName: 'Build SEALNet for iOS'
124+
inputs:
125+
solution: '$(Build.SourcesDirectory)/build/dotnet/src/SEALNet.csproj'
126+
msbuildArchitecture: 'x64'
127+
platform: 'x64'
128+
msbuildArguments: '/p:BuildIOS=1'
129+
configuration: '${{ parameters.configuration }}'
130+
msbuildVersion: 'latest'
128131

129132
- task: PublishSymbols@2
130133
displayName: 'Publish symbols path'
@@ -286,7 +289,7 @@ steps:
286289
- task: CopyFiles@2
287290
displayName: 'Copy NuSpec File to: $(Build.ArtifactStagingDirectory)'
288291
inputs:
289-
SourceFolder: '$(Build.SourcesDirectory)\dotnet\nuget\'
292+
SourceFolder: '$(Build.SourcesDirectory)\build\dotnet\nuget\'
290293
Contents: 'SEALNet-multi.nuspec'
291294
TargetFolder: '$(Build.ArtifactStagingDirectory)\dotnet\nuget\'
292295

0 commit comments

Comments
 (0)