diff --git a/.clang-format b/.clang-format index 59c40e85a..baa2408fb 100644 --- a/.clang-format +++ b/.clang-format @@ -124,4 +124,3 @@ StatementMacros: TabWidth: 4 UseTab: Never ... - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4d5d8ad81..412bdb030 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,10 @@ repos: - #- repo: https://github.com/pre-commit/pre-commit-hooks - #rev: v2.0.0 - #hooks: - #- id: check-added-large-files - #- id: check-case-conflict - #- id: check-json - #- id: check-merge-conflict - #- id: check-symlinks - #- id: check-yaml - #- id: trailing-whitespace - #- id: end-of-file-fixer + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.0.0 + hooks: + - id: check-added-large-files + - id: trailing-whitespace + - id: end-of-file-fixer - repo: local hooks: - id: clang-format diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca8c450ec..50fb25042 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,4 +22,4 @@ Microsoft SEAL uses a customized `.clang-format` configuration for C++ code styl A script `tools/scripts/clang-format-all.sh` is provided to easily format all C++ sources and headers in the `native` directory. Documentation are mostly written in GitHub-flavored Markdown. -A line break is required after each full sentence. \ No newline at end of file +A line break is required after each full sentence. diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index eca70cfe5..6b78462d6 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml index eca70cfe5..6b78462d6 100644 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/android/build.gradle b/android/build.gradle index 53c02c8db..89662a075 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,11 +6,11 @@ buildscript { repositories { google() jcenter() - + } dependencies { classpath 'com.android.tools.build:gradle:3.6.2' - + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -20,7 +20,7 @@ allprojects { repositories { google() jcenter() - + } } diff --git a/android/gradle.properties b/android/gradle.properties index e4bbb28b9..5d7ade5aa 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -20,4 +20,3 @@ org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true - diff --git a/dotnet/examples/7_Performance.cs b/dotnet/examples/7_Performance.cs index 63c55eca2..26b863353 100644 --- a/dotnet/examples/7_Performance.cs +++ b/dotnet/examples/7_Performance.cs @@ -20,7 +20,7 @@ private static void BFVPerformanceTest(SEALContext context) bool hasZLIB = Serialization.IsSupportedComprMode(ComprModeType.ZLIB); bool hasZSTD = Serialization.IsSupportedComprMode(ComprModeType.ZSTD); - + using EncryptionParameters parms = context.FirstContextData.Parms; using Modulus plainModulus = parms.PlainModulus; ulong polyModulusDegree = parms.PolyModulusDegree; diff --git a/dotnet/examples/Utilities.cs b/dotnet/examples/Utilities.cs index 63f8511b1..179bdd445 100644 --- a/dotnet/examples/Utilities.cs +++ b/dotnet/examples/Utilities.cs @@ -186,4 +186,4 @@ public static void PrintLine([CallerLineNumber] int lineNumber = 0) Console.Write("Line {0,3} --> ", lineNumber); } } -} \ No newline at end of file +} diff --git a/dotnet/nuget/NUGET.md b/dotnet/nuget/NUGET.md index 8a7315be4..1a21e3bce 100644 --- a/dotnet/nuget/NUGET.md +++ b/dotnet/nuget/NUGET.md @@ -33,4 +33,4 @@ packages in this known location. In Microsoft Visual Studio 2019, for example, y After this, you should be able to add a reference to this package in your own .NET project. After creating or opening your project in Visual Studio, you can right click on the project in the Solution Explorer window, and select `Manage NuGet packages...`. In the window that appears -you will be able to select the `Microsoft.Research.SEAL` NuGet package to add to your project. \ No newline at end of file +you will be able to select the `Microsoft.Research.SEAL` NuGet package to add to your project. diff --git a/dotnet/src/EncryptionParameterQualifiers.cs b/dotnet/src/EncryptionParameterQualifiers.cs index 34a6a23da..3bbf2800e 100644 --- a/dotnet/src/EncryptionParameterQualifiers.cs +++ b/dotnet/src/EncryptionParameterQualifiers.cs @@ -213,4 +213,4 @@ protected override void DestroyNativeObject() NativeMethods.EPQ_Destroy(NativePtr); } } -} \ No newline at end of file +} diff --git a/dotnet/src/MemoryPoolHandle.cs b/dotnet/src/MemoryPoolHandle.cs index 64911c99d..72c2af8fe 100644 --- a/dotnet/src/MemoryPoolHandle.cs +++ b/dotnet/src/MemoryPoolHandle.cs @@ -233,4 +233,4 @@ protected override void DestroyNativeObject() NativeMethods.MemoryPoolHandle_Destroy(NativePtr); } } -} \ No newline at end of file +} diff --git a/dotnet/src/SEALContext.cs b/dotnet/src/SEALContext.cs index e7a3d8434..a3e81f27e 100644 --- a/dotnet/src/SEALContext.cs +++ b/dotnet/src/SEALContext.cs @@ -518,4 +518,4 @@ protected override void DestroyNativeObject() } } } -} \ No newline at end of file +} diff --git a/dotnet/src/ValCheck.cs b/dotnet/src/ValCheck.cs index 01565fbe9..f65b47ff4 100644 --- a/dotnet/src/ValCheck.cs +++ b/dotnet/src/ValCheck.cs @@ -152,4 +152,4 @@ public static bool IsValidFor(GaloisKeys galoisKeys, SEALContext context) return result; } } -} \ No newline at end of file +} diff --git a/dotnet/tests/MemoryManagerTests.cs b/dotnet/tests/MemoryManagerTests.cs index 565391f62..dbf195b37 100644 --- a/dotnet/tests/MemoryManagerTests.cs +++ b/dotnet/tests/MemoryManagerTests.cs @@ -33,4 +33,4 @@ public void SwitchProfileTest() Assert.IsTrue(globalHandle.IsInitialized); } } -} \ No newline at end of file +} diff --git a/dotnet/tests/MemoryPoolHandleTests.cs b/dotnet/tests/MemoryPoolHandleTests.cs index 6d9f81e63..76a2f1791 100644 --- a/dotnet/tests/MemoryPoolHandleTests.cs +++ b/dotnet/tests/MemoryPoolHandleTests.cs @@ -96,4 +96,4 @@ public void ExceptionsTest() Utilities.AssertThrows(() => handle.Set(null)); } } -} \ No newline at end of file +} diff --git a/native/examples/CMakeLists.txt b/native/examples/CMakeLists.txt index c3b5d6141..9de15952d 100644 --- a/native/examples/CMakeLists.txt +++ b/native/examples/CMakeLists.txt @@ -11,4 +11,4 @@ target_sources(sealexamples ${CMAKE_CURRENT_LIST_DIR}/5_rotation.cpp ${CMAKE_CURRENT_LIST_DIR}/6_serialization.cpp ${CMAKE_CURRENT_LIST_DIR}/7_performance.cpp -) \ No newline at end of file +) diff --git a/native/examples/SEALExamples.vcxproj b/native/examples/SEALExamples.vcxproj index 770268a8c..13944a407 100644 --- a/native/examples/SEALExamples.vcxproj +++ b/native/examples/SEALExamples.vcxproj @@ -203,4 +203,4 @@ - \ No newline at end of file + diff --git a/native/examples/SEALExamples.vcxproj.filters b/native/examples/SEALExamples.vcxproj.filters index f903eae8c..97823a3e1 100644 --- a/native/examples/SEALExamples.vcxproj.filters +++ b/native/examples/SEALExamples.vcxproj.filters @@ -49,4 +49,4 @@ Header Files - \ No newline at end of file + diff --git a/native/src/SEAL.vcxproj b/native/src/SEAL.vcxproj index 5c9c1de54..096910249 100644 --- a/native/src/SEAL.vcxproj +++ b/native/src/SEAL.vcxproj @@ -353,4 +353,4 @@ - \ No newline at end of file + diff --git a/native/src/SEAL.vcxproj.filters b/native/src/SEAL.vcxproj.filters index b9742ae5e..ead7db558 100644 --- a/native/src/SEAL.vcxproj.filters +++ b/native/src/SEAL.vcxproj.filters @@ -342,4 +342,4 @@ Other - \ No newline at end of file + diff --git a/native/src/SEAL_C.vcxproj b/native/src/SEAL_C.vcxproj index 9d6ce5634..c6b6a384d 100644 --- a/native/src/SEAL_C.vcxproj +++ b/native/src/SEAL_C.vcxproj @@ -265,4 +265,4 @@ - \ No newline at end of file + diff --git a/native/src/SEAL_C.vcxproj.filters b/native/src/SEAL_C.vcxproj.filters index 967cb45f3..697fe5b4d 100644 --- a/native/src/SEAL_C.vcxproj.filters +++ b/native/src/SEAL_C.vcxproj.filters @@ -193,4 +193,4 @@ Other - \ No newline at end of file + diff --git a/native/src/seal/c/defines.h b/native/src/seal/c/defines.h index b74baaa90..1b103d464 100644 --- a/native/src/seal/c/defines.h +++ b/native/src/seal/c/defines.h @@ -56,4 +56,4 @@ static_assert(false, "Require architecture == x64"); #endif // _MSC_VER -#define SEAL_C_FUNC SEAL_C_DECOR HRESULT SEAL_C_CALL \ No newline at end of file +#define SEAL_C_FUNC SEAL_C_DECOR HRESULT SEAL_C_CALL diff --git a/native/src/seal/c/dllmain.cpp b/native/src/seal/c/dllmain.cpp index 6c36bcc2b..0af0ebf6f 100644 --- a/native/src/seal/c/dllmain.cpp +++ b/native/src/seal/c/dllmain.cpp @@ -15,4 +15,4 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserv break; } return TRUE; -} \ No newline at end of file +} diff --git a/native/src/seal/c/encryptionparameterqualifiers.h b/native/src/seal/c/encryptionparameterqualifiers.h index 4aa6a25ef..62ac926f6 100644 --- a/native/src/seal/c/encryptionparameterqualifiers.h +++ b/native/src/seal/c/encryptionparameterqualifiers.h @@ -33,4 +33,4 @@ SEAL_C_FUNC EPQ_SecLevel(void *thisptr, int *sec_level); SEAL_C_FUNC EPQ_ParameterErrorName(void *thisptr, char *outstr, uint64_t *length); -SEAL_C_FUNC EPQ_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length); \ No newline at end of file +SEAL_C_FUNC EPQ_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length); diff --git a/native/src/seal/c/galoiskeys.cpp b/native/src/seal/c/galoiskeys.cpp index b848b6aaf..ca19599fa 100644 --- a/native/src/seal/c/galoiskeys.cpp +++ b/native/src/seal/c/galoiskeys.cpp @@ -26,4 +26,4 @@ SEAL_C_FUNC GaloisKeys_GetIndex(uint32_t galois_elt, uint64_t *index) { return E_INVALIDARG; } -} \ No newline at end of file +} diff --git a/native/src/seal/c/memorymanager.cpp b/native/src/seal/c/memorymanager.cpp index ec64228c1..943fbb89a 100644 --- a/native/src/seal/c/memorymanager.cpp +++ b/native/src/seal/c/memorymanager.cpp @@ -162,4 +162,4 @@ SEAL_C_FUNC MMProf_Destroy(void *thisptr) delete profile; return S_OK; -} \ No newline at end of file +} diff --git a/native/src/seal/c/memorypoolhandle.cpp b/native/src/seal/c/memorypoolhandle.cpp index 54a477d56..f3700767a 100644 --- a/native/src/seal/c/memorypoolhandle.cpp +++ b/native/src/seal/c/memorypoolhandle.cpp @@ -133,4 +133,4 @@ SEAL_C_FUNC MemoryPoolHandle_Equals(void *thisptr, void *otherptr, bool *result) *result = (*pool == *other); return S_OK; -} \ No newline at end of file +} diff --git a/native/src/seal/c/relinkeys.cpp b/native/src/seal/c/relinkeys.cpp index 09e208a1c..c6ea6740f 100644 --- a/native/src/seal/c/relinkeys.cpp +++ b/native/src/seal/c/relinkeys.cpp @@ -26,4 +26,4 @@ SEAL_C_FUNC RelinKeys_GetIndex(uint64_t key_power, uint64_t *index) { return E_INVALIDARG; } -} \ No newline at end of file +} diff --git a/native/src/seal/c/sealcontext.h b/native/src/seal/c/sealcontext.h index bfe7f538b..0ea5ffda0 100644 --- a/native/src/seal/c/sealcontext.h +++ b/native/src/seal/c/sealcontext.h @@ -37,4 +37,4 @@ SEAL_C_FUNC SEALContext_UsingKeyswitching(void *thisptr, bool *using_keyswitchin SEAL_C_FUNC SEALContext_ParameterErrorName(void *thisptr, char *outstr, uint64_t *length); -SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length); \ No newline at end of file +SEAL_C_FUNC SEALContext_ParameterErrorMessage(void *thisptr, char *outstr, uint64_t *length); diff --git a/native/src/seal/c/version.h b/native/src/seal/c/version.h index a77b296c2..5320367bf 100644 --- a/native/src/seal/c/version.h +++ b/native/src/seal/c/version.h @@ -17,4 +17,4 @@ SEAL_C_FUNC Version_Major(uint8_t *result); SEAL_C_FUNC Version_Minor(uint8_t *result); -SEAL_C_FUNC Version_Patch(uint8_t *result); \ No newline at end of file +SEAL_C_FUNC Version_Patch(uint8_t *result); diff --git a/native/src/seal/memorymanager.cpp b/native/src/seal/memorymanager.cpp index 31976c672..24d5d2912 100644 --- a/native/src/seal/memorymanager.cpp +++ b/native/src/seal/memorymanager.cpp @@ -12,4 +12,4 @@ namespace seal #else #pragma message("WARNING: MemoryManager compiled thread-unsafe and MMProfGuard disabled to support /clr") #endif -} // namespace seal \ No newline at end of file +} // namespace seal diff --git a/native/src/seal/modulus.cpp b/native/src/seal/modulus.cpp index af6a51c05..826a3b98d 100644 --- a/native/src/seal/modulus.cpp +++ b/native/src/seal/modulus.cpp @@ -170,4 +170,4 @@ namespace seal } return result; } -} // namespace seal \ No newline at end of file +} // namespace seal diff --git a/native/src/seal/util/dwthandler.h b/native/src/seal/util/dwthandler.h index f76634375..7e05365bf 100644 --- a/native/src/seal/util/dwthandler.h +++ b/native/src/seal/util/dwthandler.h @@ -359,4 +359,4 @@ namespace seal Arithmetic arithmetic_; }; } // namespace util -} // namespace seal \ No newline at end of file +} // namespace seal diff --git a/native/src/seal/util/numth.cpp b/native/src/seal/util/numth.cpp index 06a970761..c5d0dd99e 100644 --- a/native/src/seal/util/numth.cpp +++ b/native/src/seal/util/numth.cpp @@ -423,4 +423,4 @@ namespace seal return true; } } // namespace util -} // namespace seal \ No newline at end of file +} // namespace seal diff --git a/native/tests/SEALTest.vcxproj b/native/tests/SEALTest.vcxproj index f6761b561..ee0248983 100644 --- a/native/tests/SEALTest.vcxproj +++ b/native/tests/SEALTest.vcxproj @@ -201,4 +201,4 @@ - \ No newline at end of file + diff --git a/native/tests/SEALTest.vcxproj.filters b/native/tests/SEALTest.vcxproj.filters index e894dec70..308fd2b1f 100644 --- a/native/tests/SEALTest.vcxproj.filters +++ b/native/tests/SEALTest.vcxproj.filters @@ -152,4 +152,4 @@ - \ No newline at end of file + diff --git a/native/tests/packages.config b/native/tests/packages.config index 6c6422e88..a31daddc4 100644 --- a/native/tests/packages.config +++ b/native/tests/packages.config @@ -1,4 +1,4 @@  - \ No newline at end of file + diff --git a/native/tests/seal/memorymanager.cpp b/native/tests/seal/memorymanager.cpp index dbd198828..a56fe9dc5 100644 --- a/native/tests/seal/memorymanager.cpp +++ b/native/tests/seal/memorymanager.cpp @@ -67,4 +67,4 @@ namespace sealtest } ASSERT_EQ(1L, pool.use_count()); } -} // namespace sealtest \ No newline at end of file +} // namespace sealtest diff --git a/native/tests/seal/testrunner.cpp b/native/tests/seal/testrunner.cpp index e7524d29d..ddbac2200 100644 --- a/native/tests/seal/testrunner.cpp +++ b/native/tests/seal/testrunner.cpp @@ -10,4 +10,4 @@ int main(int argc, char **argv) { testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -} \ No newline at end of file +} diff --git a/pipelines/android.yml b/pipelines/android.yml index c4dab5151..3a9b26101 100644 --- a/pipelines/android.yml +++ b/pipelines/android.yml @@ -14,7 +14,7 @@ steps: $ToolsDirectory = Join-Path -Path $Env:BUILD_SOURCESDIRECTORY -ChildPath tools $NinjaZipFile = Join-Path $ToolsDirectory -ChildPath ninja.zip $NinjaExeFile = Join-Path $ToolsDirectory -ChildPath ninja.exe - + Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-win.zip" -OutFile $NinjaZipFile Expand-Archive -Path $NinjaZipFile -DestinationPath $ToolsDirectory Copy-Item -Path $NinjaExeFile -Destination "c:\Program Files\CMake\bin" diff --git a/pipelines/pipeline-CI-Android.yml b/pipelines/pipeline-CI-Android.yml index 2e1c81f08..ce4374cbf 100644 --- a/pipelines/pipeline-CI-Android.yml +++ b/pipelines/pipeline-CI-Android.yml @@ -25,4 +25,3 @@ stages: parameters: debug: false name: Android - diff --git a/pipelines/pipeline-CI-Debug-Linux.yml b/pipelines/pipeline-CI-Debug-Linux.yml index d042186c5..148e7d8fd 100644 --- a/pipelines/pipeline-CI-Debug-Linux.yml +++ b/pipelines/pipeline-CI-Debug-Linux.yml @@ -24,4 +24,4 @@ stages: - template: jobs.yml parameters: debug: true - name: Linux \ No newline at end of file + name: Linux diff --git a/pipelines/pipeline-CI-Debug-Windows.yml b/pipelines/pipeline-CI-Debug-Windows.yml index 50995a6cb..82ec2811a 100644 --- a/pipelines/pipeline-CI-Debug-Windows.yml +++ b/pipelines/pipeline-CI-Debug-Windows.yml @@ -24,4 +24,4 @@ stages: - template: jobs.yml parameters: debug: true - name: Windows \ No newline at end of file + name: Windows diff --git a/pipelines/pipeline-CI-Debug-macOS.yml b/pipelines/pipeline-CI-Debug-macOS.yml index 6593aee61..f3466d06d 100644 --- a/pipelines/pipeline-CI-Debug-macOS.yml +++ b/pipelines/pipeline-CI-Debug-macOS.yml @@ -24,4 +24,4 @@ stages: - template: jobs.yml parameters: debug: true - name: macOS \ No newline at end of file + name: macOS diff --git a/tools/scripts/clang-format-all.sh b/tools/scripts/clang-format-all.sh index c132dabf6..080d4c900 100755 --- a/tools/scripts/clang-format-all.sh +++ b/tools/scripts/clang-format-all.sh @@ -7,4 +7,4 @@ BASE_DIR=$(dirname "$0") SEAL_ROOT_DIR=$BASE_DIR/../../ shopt -s globstar clang-format -i $SEAL_ROOT_DIR/native/**/*.h -clang-format -i $SEAL_ROOT_DIR/native/**/*.cpp \ No newline at end of file +clang-format -i $SEAL_ROOT_DIR/native/**/*.cpp diff --git a/tools/scripts/collect_system_info.sh b/tools/scripts/collect_system_info.sh index a6abbee16..df0113c76 100755 --- a/tools/scripts/collect_system_info.sh +++ b/tools/scripts/collect_system_info.sh @@ -14,7 +14,7 @@ echo "Extracting: cmake -LA $SEALDIR > $CMAKE_ENV" cmake -LA $SEALDIR > $CMAKE_ENV echo "Extracting: cmake --system-information > $CMAKE_SYSTEM_INFO" cmake --system-information > $CMAKE_SYSTEM_INFO -echo "Extracting: $CMAKE_CXX_COMPILER_CMD -v > $CMAKE_CXX_COMPILER 2>&1" +echo "Extracting: $CMAKE_CXX_COMPILER_CMD -v > $CMAKE_CXX_COMPILER 2>&1" $CMAKE_CXX_COMPILER_CMD -v 2> $CMAKE_CXX_COMPILER ARCHIVE_NAME=../system_info.tar