Skip to content

Commit 7cd77fb

Browse files
committed
v4.3.0: bump version, fix C API string copy, restructure iOS pipeline
1 parent 6de037d commit 7cd77fb

9 files changed

Lines changed: 77 additions & 47 deletions

File tree

CHANGES.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# List of Changes
22

3+
## Version 4.3.0
4+
5+
- Merged [(PR #734)](https://github.com/microsoft/SEAL/pull/734): Fixed `IterTuple` constructors that returned references to local temporaries.
6+
- Merged [(PR #738)](https://github.com/microsoft/SEAL/pull/738): Fixed out-of-bounds read in `Serialization_IsCompatibleVersion` and `Serialization_IsValidHeader` (C API).
7+
- Bumped .NET target framework from `net8.0` to `net10.0`.
8+
- Added `cmake/ios_xcframework.cmake` and a CI artifact that produces `libseal-<ver>.xcframework` and `libsealc-<ver>.xcframework` in one command.
9+
- Added `CMakePresets.json` for Windows, Linux, and macOS development.
10+
- No further releases will be published to NuGet.org. Users who want newer versions in .NET projects should build their own NuGet package from source.
11+
312
## Version 4.2.0
413

514
- Merged [(PR #729)](https://github.com/microsoft/SEAL/pull/729): Updated `zlib` and `zstd` versions.

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ endif()
1616
# 4. SEAL C++ tests #
1717
###################################################
1818

19-
project(SEAL VERSION 4.2.0 LANGUAGES CXX C)
19+
project(SEAL VERSION 4.3.0 LANGUAGES CXX C)
2020

2121
# [option] CMAKE_BUILD_TYPE (default: "Release")
2222
# Build in one of the following modes: Release, Debug, MinSizeRel, or RelWithDebInfo.

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Microsoft SEAL is an easy-to-use open-source ([MIT licensed](LICENSE)) homomorph
44
Microsoft SEAL is written in modern standard C++ and is easy to compile and run in many different environments.
55
For more information about the Microsoft SEAL project, see [sealcrypto.org](https://www.microsoft.com/en-us/research/project/microsoft-seal).
66

7-
This document pertains to Microsoft SEAL version 4.2.
7+
This document pertains to Microsoft SEAL version 4.3.
88
Users of previous versions of the library should look at the [list of changes](CHANGES.md).
99

1010
## Contents
@@ -317,7 +317,7 @@ cmake -P cmake/ios_xcframework.cmake
317317
cmake -DBUILD_TYPE=Debug -DOUTPUT_DIR=./out -P cmake/ios_xcframework.cmake
318318
```
319319

320-
This configures and builds for both device (`iphoneos`) and simulator (`iphonesimulator`), installs both, and creates `libseal-4.2.xcframework` and `libsealc-4.2.xcframework`.
320+
This configures and builds for both device (`iphoneos`) and simulator (`iphonesimulator`), installs both, and creates `libseal-4.3.xcframework` and `libsealc-4.3.xcframework`.
321321
Both slices target `arm64`.
322322
Intermediate build files are placed in `out/ios-xcframework/` by default; override with `-DWORK_DIR=<path>`.
323323

@@ -354,25 +354,25 @@ cmake --install $D/build-simulator --config Release --prefix $D/install-simulato
354354
# Stage headers per slice. XCFramework requires separate header trees because
355355
# generated files (e.g. config.h) can differ between device and simulator.
356356
mkdir -p $D/staging/device $D/staging/simulator
357-
rsync -a $D/install-device/include/SEAL-4.2/ $D/staging/device/
358-
rsync -a $D/install-simulator/include/SEAL-4.2/ $D/staging/simulator/
357+
rsync -a $D/install-device/include/SEAL-4.3/ $D/staging/device/
358+
rsync -a $D/install-simulator/include/SEAL-4.3/ $D/staging/simulator/
359359

360360
# xcodebuild refuses to overwrite an existing .xcframework output.
361-
rm -rf libseal-4.2.xcframework libsealc-4.2.xcframework
361+
rm -rf libseal-4.3.xcframework libsealc-4.3.xcframework
362362

363363
# Create the XCFrameworks.
364364
xcodebuild -create-xcframework \
365-
-library $D/install-device/lib/libseal-4.2.a \
365+
-library $D/install-device/lib/libseal-4.3.a \
366366
-headers $D/staging/device \
367-
-library $D/install-simulator/lib/libseal-4.2.a \
367+
-library $D/install-simulator/lib/libseal-4.3.a \
368368
-headers $D/staging/simulator \
369-
-output libseal-4.2.xcframework
369+
-output libseal-4.3.xcframework
370370
xcodebuild -create-xcframework \
371-
-library $D/install-device/lib/libsealc-4.2.a \
371+
-library $D/install-device/lib/libsealc-4.3.a \
372372
-headers $D/staging/device \
373-
-library $D/install-simulator/lib/libsealc-4.2.a \
373+
-library $D/install-simulator/lib/libsealc-4.3.a \
374374
-headers $D/staging/simulator \
375-
-output libsealc-4.2.xcframework
375+
-output libsealc-4.3.xcframework
376376
```
377377

378378
</details>
@@ -422,7 +422,7 @@ emcc \
422422
-Wall \
423423
-flto \
424424
-O3 \
425-
build/lib/libseal-4.2.a \
425+
build/lib/libseal-4.3.a \
426426
--bind \
427427
-o "build/bin/seal_wasm.js" \
428428
-s WASM=1 \
@@ -486,7 +486,7 @@ It is very easy to link your own applications and libraries with Microsoft SEAL
486486
Simply add the following to your `CMakeLists.txt`:
487487

488488
```PowerShell
489-
find_package(SEAL 4.2 REQUIRED)
489+
find_package(SEAL 4.3 REQUIRED)
490490
target_link_libraries(<your target> SEAL::seal)
491491
```
492492

@@ -566,6 +566,19 @@ For contributing to Microsoft SEAL, please see [CONTRIBUTING.md](CONTRIBUTING.md
566566

567567
To cite Microsoft SEAL in academic papers, please use the following BibTeX entries.
568568

569+
### Version 4.3
570+
571+
```tex
572+
@misc{sealcrypto,
573+
title = {{M}icrosoft {SEAL} (release 4.3)},
574+
howpublished = {\url{https://github.com/Microsoft/SEAL}},
575+
month = apr,
576+
year = 2026,
577+
note = {Microsoft Research, Redmond, WA.},
578+
key = {SEAL}
579+
}
580+
```
581+
569582
### Version 4.2
570583

571584
```tex

android/app/build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ plugins {
22
alias(libs.plugins.android.application)
33
}
44

5+
def sealVersion = {
6+
def m = file('../../CMakeLists.txt').text =~ /project\(SEAL VERSION (\d+\.\d+\.\d+)/
7+
if (!m.find()) throw new GradleException("Could not parse SEAL version from CMakeLists.txt")
8+
return m.group(1)
9+
}()
10+
511
android {
612
namespace 'com.microsoft.research.SEAL'
713
compileSdk 35
@@ -11,7 +17,7 @@ android {
1117
minSdk 35
1218
targetSdk 35
1319
versionCode 2
14-
versionName "4.2.0"
20+
versionName sealVersion
1521

1622
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1723
externalNativeBuild {

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.25)
55

6-
project(SEALBench VERSION 4.2.0 LANGUAGES CXX)
6+
project(SEALBench VERSION 4.3.0 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 4.2.0 EXACT REQUIRED)
13+
find_package(SEAL 4.3.0 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.25)
55

6-
project(SEALExamples VERSION 4.2.0 LANGUAGES CXX)
6+
project(SEALExamples VERSION 4.3.0 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 4.2.0 EXACT REQUIRED)
13+
find_package(SEAL 4.3.0 EXACT REQUIRED)
1414

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

native/src/seal/c/sealcontext.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,7 @@ SEAL_C_FUNC SEALContext_ParameterErrorName(void *thisptr, char *outstr, uint64_t
145145
IfNullRet(context, E_POINTER);
146146
IfNullRet(length, E_POINTER);
147147

148-
const char *str = context->parameter_error_name();
149-
*length = static_cast<uint64_t>(strlen(str));
150-
151-
if (nullptr != outstr)
152-
{
153-
memcpy(outstr, str, *length);
154-
}
155-
return S_OK;
148+
return ToStringHelper2(context->parameter_error_name(), outstr, length);
156149
}
157150

158151
SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length)
@@ -161,12 +154,5 @@ SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint6
161154
IfNullRet(context, E_POINTER);
162155
IfNullRet(length, E_POINTER);
163156

164-
const char *str = context->parameter_error_message();
165-
*length = static_cast<uint64_t>(strlen(str));
166-
167-
if (nullptr != outstr)
168-
{
169-
memcpy(outstr, str, *length);
170-
}
171-
return S_OK;
157+
return ToStringHelper2(context->parameter_error_message(), outstr, length);
172158
}

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.25)
55

6-
project(SEALTest VERSION 4.2.0 LANGUAGES CXX C)
6+
project(SEALTest VERSION 4.3.0 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 4.2.0 EXACT REQUIRED)
13+
find_package(SEAL 4.3.0 EXACT REQUIRED)
1414

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

pipelines/ios.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,42 @@
11
steps:
22
- task: CMake@1
3-
displayName: 'Configure SEAL for arm64'
3+
displayName: 'Configure SEAL for iOS device (arm64)'
44
inputs:
55
workingDirectory: '$(Build.SourcesDirectory)'
66
cmakeArgs: >
77
-S .
8-
-B build-arm64
8+
-B build-device
99
-GXcode
1010
-DSEAL_BUILD_SEAL_C=ON
1111
-DSEAL_BUILD_STATIC_SEAL_C=ON
1212
-DCMAKE_SYSTEM_NAME=iOS
13+
-DCMAKE_OSX_SYSROOT=iphoneos
14+
-DCMAKE_OSX_ARCHITECTURES=arm64
15+
-C cmake/functions.ios.cmake
16+
17+
- task: CMake@1
18+
displayName: 'Configure SEAL for iOS simulator (arm64)'
19+
inputs:
20+
workingDirectory: '$(Build.SourcesDirectory)'
21+
cmakeArgs: >
22+
-S .
23+
-B build-simulator
24+
-GXcode
25+
-DSEAL_BUILD_SEAL_C=ON
26+
-DSEAL_BUILD_STATIC_SEAL_C=ON
27+
-DCMAKE_SYSTEM_NAME=iOS
28+
-DCMAKE_OSX_SYSROOT=iphonesimulator
1329
-DCMAKE_OSX_ARCHITECTURES=arm64
1430
-C cmake/functions.ios.cmake
1531
1632
- script: |
1733
cd $BUILD_SOURCESDIRECTORY
18-
xcodebuild -project build-arm64/SEAL.xcodeproj -sdk iphonesimulator -arch arm64 -configuration ${{ parameters.configuration }} clean build
34+
xcodebuild -project build-simulator/SEAL.xcodeproj -sdk iphonesimulator -arch arm64 -configuration ${{ parameters.configuration }} clean build
1935
mkdir -p $BUILD_SOURCESDIRECTORY/lib/iossimulator
2036
21-
echo Copying arm64 libraries from build-arm64/lib/${{ parameters.configuration }}/
22-
cp build-arm64/lib/${{ parameters.configuration }}/libseal-*.a $BUILD_SOURCESDIRECTORY/lib/iossimulator/libseal.a
23-
cp build-arm64/lib/${{ parameters.configuration }}/libsealc-*.a $BUILD_SOURCESDIRECTORY/lib/iossimulator/libsealc.a
37+
echo Copying arm64 libraries from build-simulator/lib/${{ parameters.configuration }}/
38+
cp build-simulator/lib/${{ parameters.configuration }}/libseal-*.a $BUILD_SOURCESDIRECTORY/lib/iossimulator/libseal.a
39+
cp build-simulator/lib/${{ parameters.configuration }}/libsealc-*.a $BUILD_SOURCESDIRECTORY/lib/iossimulator/libsealc.a
2440
2541
echo Architectures for iossimulator/libseal.a
2642
lipo -info $BUILD_SOURCESDIRECTORY/lib/iossimulator/libseal.a
@@ -31,12 +47,12 @@ steps:
3147

3248
- script: |
3349
cd $BUILD_SOURCESDIRECTORY
34-
xcodebuild -project build-arm64/SEAL.xcodeproj -sdk iphoneos -arch arm64 -configuration ${{ parameters.configuration }} clean build
50+
xcodebuild -project build-device/SEAL.xcodeproj -sdk iphoneos -arch arm64 -configuration ${{ parameters.configuration }} clean build
3551
mkdir -p $BUILD_SOURCESDIRECTORY/lib/ios
3652
37-
echo Copying arm64 libraries from build-arm64/lib/${{ parameters.configuration }}/
38-
cp build-arm64/lib/${{ parameters.configuration }}/libseal-*.a $BUILD_SOURCESDIRECTORY/lib/ios/libseal.a
39-
cp build-arm64/lib/${{ parameters.configuration }}/libsealc-*.a $BUILD_SOURCESDIRECTORY/lib/ios/libsealc.a
53+
echo Copying arm64 libraries from build-device/lib/${{ parameters.configuration }}/
54+
cp build-device/lib/${{ parameters.configuration }}/libseal-*.a $BUILD_SOURCESDIRECTORY/lib/ios/libseal.a
55+
cp build-device/lib/${{ parameters.configuration }}/libsealc-*.a $BUILD_SOURCESDIRECTORY/lib/ios/libsealc.a
4056
displayName: 'Build SEAL for iOS (arm64)'
4157

4258
- task: CopyFiles@2

0 commit comments

Comments
 (0)