From 335adc2f2b0a84af3f7d175a214cb7f36304938e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 13:07:35 +0000 Subject: [PATCH 01/24] Bump Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) and [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest). These dependencies needed to be updated together. Updates `Microsoft.NET.Test.Sdk` from 17.8.0 to 17.9.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.8.0...v17.9.0) Updates `Microsoft.TestPlatform.ObjectModel` from 17.8.0 to 17.9.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.8.0...v17.9.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.TestPlatform.ObjectModel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 7047b06..2c1a087 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive From 6aa820fec99a53c862b318a0fedd58758ae7e530 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:23:40 +0000 Subject: [PATCH 02/24] Bump xunit from 2.6.4 to 2.7.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.6.4 to 2.7.0. - [Commits](https://github.com/xunit/xunit/compare/2.6.4...2.7.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 2c1a087..4017d9b 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From e7ac5526d65055eba262041cf0f9ca9bc68ee3a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 22:32:33 +0000 Subject: [PATCH 03/24] Bump xunit.runner.visualstudio from 2.5.6 to 2.5.7 Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.6 to 2.5.7. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.6...2.5.7) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 4017d9b..c5d3886 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From b649e3b4686bdc8a9088339c140028029bd43cd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 13:07:56 +0000 Subject: [PATCH 04/24] Bump xunit from 2.7.0 to 2.8.0 Bumps [xunit](https://github.com/xunit/xunit) from 2.7.0 to 2.8.0. - [Commits](https://github.com/xunit/xunit/compare/2.7.0...2.8.0) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index c5d3886..10be6ee 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 554d79bf4e0aa106c794778233e97b01fea92c1c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 May 2024 20:41:23 +0000 Subject: [PATCH 05/24] Bump xunit.runner.visualstudio from 2.5.7 to 2.8.0 Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.5.7 to 2.8.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.5.7...2.8.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 10be6ee..024b262 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 0b10624a4f19122694c4790c1f61ba539e0fd34d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 14:00:31 +0000 Subject: [PATCH 06/24] Bump Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) and [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest). These dependencies needed to be updated together. Updates `Microsoft.NET.Test.Sdk` from 17.9.0 to 17.10.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.9.0...v17.10.0) Updates `Microsoft.TestPlatform.ObjectModel` from 17.9.0 to 17.10.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.9.0...v17.10.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.TestPlatform.ObjectModel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 024b262..a9c8d31 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive From b9e268862cc549bed43bea0d8659d64651475d90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Jun 2024 19:25:49 +0000 Subject: [PATCH 07/24] Bump xunit from 2.8.0 to 2.8.1 Bumps [xunit](https://github.com/xunit/xunit) from 2.8.0 to 2.8.1. - [Commits](https://github.com/xunit/xunit/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index a9c8d31..e94936e 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 661fcfc1bc3368114e85b88738683c4ee3cd0fd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:56:56 +0000 Subject: [PATCH 08/24] Bump xunit.runner.visualstudio from 2.8.0 to 2.8.1 Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.8.0 to 2.8.1. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](https://github.com/xunit/visualstudio.xunit/compare/2.8.0...2.8.1) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index e94936e..fbd5778 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 969719c50bbb24c5690fedb47a8618720ed04a51 Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Fri, 28 Jun 2024 00:24:35 +0200 Subject: [PATCH 09/24] .NET 7 Support: Removed Resolves: No entry --- CHANGELOG.md | 4 ++++ README.md | 18 ++++++------------ src/SecretSharingDotNet.csproj | 2 +- tests/SecretSharingDotNetTest.csproj | 2 +- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fa7bb5..0f1465c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Removed +- Removed .NET 7 support, because it retires on May 14, 2024. See [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). + ## [0.11.0] - 2023-12-30 ### Added - Added support for .NET FX v4.8.1 diff --git a/README.md b/README.md index b7bd551..a280f32 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ An C# implementation of Shamir's Secret Sharing. - Build status - SecretSharingDotNet.sln - SDK + Build status + SecretSharingDotNet.sln + SDK Standard 2.0 @@ -39,9 +39,6 @@ An C# implementation of Shamir's Secret Sharing. .NET 6 - - .NET 7 - .NET 8 @@ -61,9 +58,9 @@ An C# implementation of Shamir's Secret Sharing. - SecretSharingDotNet NuGet - NuGet Version 0.11.0 - Tag + SecretSharingDotNet NuGet + NuGet Version 0.11.0 + Tag Standard 2.0 @@ -87,9 +84,6 @@ An C# implementation of Shamir's Secret Sharing. .NET 6 - - .NET 7 - .NET 8 diff --git a/src/SecretSharingDotNet.csproj b/src/SecretSharingDotNet.csproj index a196c0b..85d9089 100644 --- a/src/SecretSharingDotNet.csproj +++ b/src/SecretSharingDotNet.csproj @@ -5,7 +5,7 @@ SecretSharingDotNet Library latest - netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net6.0;net7.0;net8.0 + netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net6.0;net8.0 SecretSharingDotNet.snk True false diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index fbd5778..6300422 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -2,7 +2,7 @@ latest - net462;net47;net471;net472;net48;net481;net6.0;net7.0;net8.0 + net462;net47;net471;net472;net48;net481;net6.0;net8.0 ..\src\SecretSharingDotNet.snk True false From d8cb5da89fbf3569ae5c9773101ce06fa3f7ed3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 13:07:53 +0000 Subject: [PATCH 10/24] Bump xunit from 2.8.1 to 2.9.0 Bumps xunit from 2.8.1 to 2.9.0. --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 6300422..c3eb01a 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 92dc463867f38aa825abf0e907963d17eb0a072c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 16:54:01 +0000 Subject: [PATCH 11/24] Bump xunit.runner.visualstudio from 2.8.1 to 2.8.2 Bumps xunit.runner.visualstudio from 2.8.1 to 2.8.2. --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index c3eb01a..8812629 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -14,7 +14,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From ae0234c2abc6596ee1ab57c02bb5bc46bf271fef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:22:55 +0000 Subject: [PATCH 12/24] Bump Microsoft.NET.Test.Sdk and Microsoft.TestPlatform.ObjectModel Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) and [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest). These dependencies needed to be updated together. Updates `Microsoft.NET.Test.Sdk` from 17.10.0 to 17.11.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.10.0...v17.11.0) Updates `Microsoft.TestPlatform.ObjectModel` from 17.10.0 to 17.11.0 - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.10.0...v17.11.0) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: Microsoft.TestPlatform.ObjectModel dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 8812629..4e20b70 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -11,8 +11,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive From 948d7c4a7acff35c013b72361bb12a4d8ca1fc8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:00:12 +0000 Subject: [PATCH 13/24] Bump actions/setup-dotnet from 4.0.0 to 4.0.1 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v4.0.0...v4.0.1) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 6 +++--- .github/workflows/dotnetall.yml | 6 +++--- .github/workflows/publishing.yml | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7b7ed0a..d758a95 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,17 +42,17 @@ jobs: uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 6.0.416 - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 7.0.403 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 8.0.100 diff --git a/.github/workflows/dotnetall.yml b/.github/workflows/dotnetall.yml index f41ac11..9388169 100644 --- a/.github/workflows/dotnetall.yml +++ b/.github/workflows/dotnetall.yml @@ -19,17 +19,17 @@ jobs: - uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 6.0.416 - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 7.0.403 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 8.0.100 diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 0f2b11d..9af9299 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -17,17 +17,17 @@ jobs: - uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 6.0.416 - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 7.0.403 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.0 + uses: actions/setup-dotnet@v4.0.1 with: dotnet-version: 8.0.100 From 2a30eb83ba2203f558c038d32b499d5029cab6c9 Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Fri, 28 Jun 2024 00:14:06 +0200 Subject: [PATCH 14/24] IMakeSharesUseCase & IReconstructionUseCase: Initial import Resolves: No entry --- CHANGELOG.md | 4 ++ README.md | 40 +++++++++++++++++++- src/Cryptography/FinitePoint`1.cs | 31 ++++++++-------- src/Cryptography/IMakeSharesUseCase.cs | 43 ++++++++++++++++++++++ src/Cryptography/IReconstructionUseCase.cs | 38 +++++++++++++++++++ src/Cryptography/Secret`1.cs | 6 +-- src/Cryptography/ShamirsSecretSharing`3.cs | 39 +++++++++++--------- src/Cryptography/SharedSeparator.cs | 2 +- src/Cryptography/Shares.cs | 14 +++---- src/Math/BigIntCalculator.cs | 8 ++-- src/Math/Calculator.cs | 2 +- src/Math/Calculator`1.cs | 13 +++---- src/Math/ExtendedGcdResult.cs | 2 +- src/Math/IExtendedGcdAlgorithm`2.cs | 8 ++-- 14 files changed, 186 insertions(+), 64 deletions(-) create mode 100644 src/Cryptography/IMakeSharesUseCase.cs create mode 100644 src/Cryptography/IReconstructionUseCase.cs diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f1465c..574bf03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Added use-case interfaces `IMakeSharesUseCase` and `IReconstructUseCase` to the `SecretSharingDotNet` project. +- Added a guide to the `README.md` file on how to use the use-case interfaces with dependency injection. + ### Removed - Removed .NET 7 support, because it retires on May 14, 2024. See [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). diff --git a/README.md b/README.md index a280f32..deb3b57 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,45 @@ An C# implementation of Shamir's Secret Sharing. Use the function `MakeShares` to generate the shares, based on a random or pre-defined secret. Afterwards, use the function `Reconstruction` to re-construct the original secret. -The length of the shares is based on the security level. It's possible to pre-define a security level by `ctor` or the `SecurityLevel` property. The pre-defined security level will be overriden, if the secret size is greater than the Mersenne prime, which is calculated by means of the security level. It is not necessary to define a security level for a re-construction. +The length of the shares is based on the security level. It is possible to pre-define a security level by `ctor` or the `SecurityLevel` property. The pre-defined security level will be overriden, if the secret size is greater than the Mersenne prime, which is calculated by means of the security level. It is not necessary to define a security level for a re-construction. + +## Using the SecretSharingDotNet library with DI in a .NET project. +This guide will demonstrate how to use the SecretSharingDotNet library with Dependency Injection (DI) in a .NET project. + +Firstly, add the following dependencies: +```csharp +using Microsoft.Extensions.DependencyInjection; +using SecretSharingDotNet.Cryptography; +using SecretSharingDotNet.Math; +using System.Numerics; +``` +Next, initialize a `ServiceCollection` instance and add dependencies to the DI container: +```csharp +var serviceCollection = new ServiceCollection(); +serviceCollection.AddSingleton, ExtendedEuclideanAlgorithm>(); +serviceCollection.AddSingleton, ShamirsSecretSharing>(); +serviceCollection.AddSingleton, ShamirsSecretSharing>(); +using var serviceProvider = serviceCollection.BuildServiceProvider(); +``` +In the code above, the `ServiceCollection` registers an implementation for each of the main components of the SecretSharingDotNet library. + +Next, create an instance of the `IMakeSharesUseCase`: +```csharp +var makeSharesUseCase = serviceProvider.GetRequiredService>(); +``` +Using this instance, it is possible to create shares from a secret: +```csharp +var shares = makeSharesUseCase.MakeShares(3, 7, "Hello!"); +Console.WriteLine(shares); +``` +Similarly, an instance of `IReconstructionUseCase` can be created to rebuild the original secret: +```csharp +var reconstructionUseCase = serviceProvider.GetRequiredService>(); +var reconstruction = reconstructionUseCase.Reconstruction(shares.Where(p => p.X.IsEven).ToArray()); +Console.WriteLine(reconstruction); +``` + +The code above reconstructs the original secret from the shares, and then outputs it. ## Random secret Create a random secret in conjunction with the generation of shares. The length of the generated shares and of the secret are based on the security level. Here is an example with a pre-defined security level of 127: diff --git a/src/Cryptography/FinitePoint`1.cs b/src/Cryptography/FinitePoint`1.cs index de6a39c..eb97fb7 100644 --- a/src/Cryptography/FinitePoint`1.cs +++ b/src/Cryptography/FinitePoint`1.cs @@ -154,39 +154,39 @@ public FinitePoint(Calculator x, Calculator y) /// /// The left operand /// The right operand - /// Returns if its operands are not equal, otherwise . + /// Returns if its operands aren't equal, otherwise . public static bool operator !=(FinitePoint left, FinitePoint right) => !left.Equals(right); /// /// Greater than operator /// - /// The 1st operand - /// The 2nd operand - /// Returns if its 1st operand is greater than its 2nd operand, otherwise . + /// The first operand + /// The second operand + /// Returns if its first operand is greater than its second operand, otherwise . public static bool operator >(FinitePoint left, FinitePoint right) => left.CompareTo(right) == 1; /// /// Less than operator /// - /// The 1st operand - /// The 2nd operand - /// Returns if its 1st operand is less than its 2nd operand, otherwise . + /// The first operand + /// The second operand + /// Returns if its first operand is less than its second operand, otherwise . public static bool operator <(FinitePoint left, FinitePoint right) => left.CompareTo(right) == -1; /// /// Greater than or equal operator /// /// The 1st operand - /// The 2nd operand - /// Returns if its 1st operand is greater than or equal to its 2nd operand, otherwise . + /// The second operand + /// Returns if its first operand is greater than or equal to its second operand, otherwise . public static bool operator >=(FinitePoint left, FinitePoint right) => left.CompareTo(right) >= 0; /// /// Less than or equal operator /// - /// The 1st operand - /// The 2nd operand - /// Returns if its 1st operand is less than or equal to its 2nd operand, otherwise . + /// The first operand + /// The second operand + /// Returns if its first operand is less than or equal to its second operand, otherwise . public static bool operator <=(FinitePoint left, FinitePoint right) => left.CompareTo(right) <= 0; /// @@ -251,7 +251,7 @@ private static Calculator Evaluate(IEnumerable> pol /// Converts a byte collection to hexadecimal string. /// /// - /// human readable / printable string + /// human-readable / printable string /// /// Based on discussion on stackoverflow /// @@ -287,8 +287,7 @@ private static string ToHexString(IEnumerable bytes) private static byte[] ToByteArray(string hexString) { byte[] bytes = new byte[hexString.Length / 2]; - var hexValues = Array.AsReadOnly(new[] - { + var hexValues = Array.AsReadOnly([ 0x00, 0x01, 0x02, @@ -312,7 +311,7 @@ private static byte[] ToByteArray(string hexString) 0x0D, 0x0E, 0x0F - }); + ]); for (int i = 0, j = 0; j < hexString.Length; j += 2, i += 1) { diff --git a/src/Cryptography/IMakeSharesUseCase.cs b/src/Cryptography/IMakeSharesUseCase.cs new file mode 100644 index 0000000..bfed74e --- /dev/null +++ b/src/Cryptography/IMakeSharesUseCase.cs @@ -0,0 +1,43 @@ +namespace SecretSharingDotNet.Cryptography; + +/// +/// Interface for the Shamir's Secret Sharing algorithm implementation for creating shared secrets. +/// +/// Numeric data type (An integer type) +public interface IMakeSharesUseCase +{ + /// + /// Generates a random shamir pool, returns the random secret and the share points. + /// + /// Minimum number of shared secrets for reconstruction + /// Maximum number of shared secrets + /// Security level (in number of bits). The minimum is 13. + /// A object + /// + /// The parameter is lower than 13 or greater than 43.112.609. OR The parameter is lower than 2 or greater than . + /// + Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberOfShares, int securityLevel); + + /// + /// Generates a random shamir pool, returns the specified and the share points. + /// + /// Minimum number of shared secrets for reconstruction + /// Maximum number of shared secrets + /// secret text as or see cref="string"/> + /// Security level (in number of bits). The minimum is 13. + /// A object + /// + /// The is lower than 13 or greater than 43.112.609. OR is lower than 2 or greater than . + /// + Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberOfShares, Secret secret, int securityLevel); + + /// + /// Generates a random shamir pool, returns the specified and the share points. + /// + /// Minimum number of shared secrets for reconstruction + /// Maximum number of shared secrets + /// secret text as or see cref="string"/> + /// A object + /// is lower than 2 or greater than . + Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberOfShares, Secret secret); +} \ No newline at end of file diff --git a/src/Cryptography/IReconstructionUseCase.cs b/src/Cryptography/IReconstructionUseCase.cs new file mode 100644 index 0000000..21c6efc --- /dev/null +++ b/src/Cryptography/IReconstructionUseCase.cs @@ -0,0 +1,38 @@ +namespace SecretSharingDotNet.Cryptography; + +/// +/// Interface for the Shamir's Secret Sharing algorithm implementation for reconstructing the secret. +/// +/// +public interface IReconstructionUseCase +{ + /// + /// Recovers the secret from the given (points with x and y on the polynomial) + /// + /// Shares represented by and separated by newline. + /// Re-constructed secret + Secret Reconstruction(string shares); + + /// + /// Recovers the secret from the given (points with x and y on the polynomial) + /// + /// Shares represented by array. + /// Re-constructed secret + Secret Reconstruction(string[] shares); + + /// + /// Recovers the secret from the given (points with x and y on the polynomial) + /// + /// For details + /// Re-constructed secret + Secret Reconstruction(Shares shares); + + /// + /// Recovers the secret from the given (points with x and y on the polynomial) + /// + /// Two or more shares represented by a set of + /// Re-constructed secret + /// is . + /// The length of is lower than 2. + Secret Reconstruction(FinitePoint[] shares); +} \ No newline at end of file diff --git a/src/Cryptography/Secret`1.cs b/src/Cryptography/Secret`1.cs index df441f6..dcd5897 100644 --- a/src/Cryptography/Secret`1.cs +++ b/src/Cryptography/Secret`1.cs @@ -235,7 +235,7 @@ public static implicit operator Secret(ReadOnlySpan secretText) /// /// The left operand /// The right operand - /// Returns if its operands are not equal, otherwise . + /// Returns if its operands aren't equal, otherwise . public static bool operator !=(Secret left, Secret right) => !left.Equals(right); /// @@ -276,8 +276,8 @@ public static implicit operator Secret(ReadOnlySpan secretText) /// An instance to compare with this instance. /// A value that indicates the relative order of the instances being compared. public int CompareTo(Secret other) => this.secretNumber - .Subset(0, this.SecretByteSize - MarkByteCount).CompareTo(other.secretNumber - .Subset(0, other.SecretByteSize - MarkByteCount)); + .Subset(0, this.SecretByteSize - MarkByteCount) + .CompareTo(other.secretNumber.Subset(0, other.SecretByteSize - MarkByteCount)); /// /// Determines whether this instance and an specified instance are equal. diff --git a/src/Cryptography/ShamirsSecretSharing`3.cs b/src/Cryptography/ShamirsSecretSharing`3.cs index 2f5531c..c6edb10 100644 --- a/src/Cryptography/ShamirsSecretSharing`3.cs +++ b/src/Cryptography/ShamirsSecretSharing`3.cs @@ -41,9 +41,10 @@ namespace SecretSharingDotNet.Cryptography; /// Shamir's secret sharing algorithm /// /// Numeric data type -/// -/// -public class ShamirsSecretSharing : ShamirsSecretSharing +/// Extended greatest common divisor algorithm +/// Extended greatest common divisor result +public class ShamirsSecretSharing : ShamirsSecretSharing, + IMakeSharesUseCase, IReconstructionUseCase where TExtendedGcdAlgorithm : class, IExtendedGcdAlgorithm where TExtendedGcdResult : struct, IExtendedGcdResult { @@ -70,21 +71,21 @@ public class ShamirsSecretSharing /// Gets or sets the security level /// - /// Value is lower than 13 or greater than 43112609. - /// Value is lower than 13 or greater than 43112609. + /// The value is lower than 13 or greater than 43.112.609. + /// The value is lower than 13 or greater than 43.112.609. public int SecurityLevel { get => this.fixedSecurityLevel; set { - if (value < 13) + if (value < SecurityLevels[0]) { throw new ArgumentOutOfRangeException(nameof(value), value, ErrorMessages.MinimumSecurityLevelExceeded); } @@ -112,9 +113,11 @@ public int SecurityLevel /// /// Minimum number of shared secrets for reconstruction /// Maximum number of shared secrets - /// Security level (in number of bits). Minimum is 13. + /// Security level (in number of bits). The minimum is 13. /// - /// The parameter is lower than 13 or greater than 43112609. OR The parameter is lower than 2 or greater than . + /// + /// The parameter is lower than 13 or greater than 43.112.609. OR The parameter is lower than 2 or greater than . + /// public Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberOfShares, int securityLevel) { try @@ -156,10 +159,12 @@ public Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberO /// Minimum number of shared secrets for reconstruction /// Maximum number of shared secrets /// secret text as or see cref="string"/> - /// Security level (in number of bits). Minimum is 13. + /// Security level (in number of bits). The minimum is 13. /// /// This method can modify the based on the length. - /// The is lower than 13 or greater than 43112609. OR is lower than 2 or greater than . + /// + /// The is lower than 13 or greater than 43.112.609. OR is lower than 2 or greater than . + /// public Shares MakeShares(TNumber numberOfMinimumShares, TNumber numberOfShares, Secret secret, int securityLevel) { try @@ -220,13 +225,11 @@ private Calculator[] CreatePolynomial(int numberOfMinimumShares) var polynomial = new Calculator[numberOfMinimumShares]; polynomial[0] = Calculator.Zero; byte[] randomNumber = new byte[this.mersennePrime.ByteCount]; - using (var rng = RandomNumberGenerator.Create()) + using var rng = RandomNumberGenerator.Create(); + for (int i = 1; i < numberOfMinimumShares; i++) { - for (int i = 1; i < numberOfMinimumShares; i++) - { - rng.GetBytes(randomNumber); - polynomial[i] = (Calculator.Create(randomNumber, typeof(TNumber)) as Calculator)?.Abs() % this.mersennePrime; - } + rng.GetBytes(randomNumber); + polynomial[i] = (Calculator.Create(randomNumber, typeof(TNumber)) as Calculator)?.Abs() % this.mersennePrime; } return polynomial; @@ -293,7 +296,7 @@ private static Calculator Product(IReadOnlyList> va /// k points will define a polynomial of up to kth order /// /// The shares represented by a set of . - /// A prime number must be defined to avoid computation with real numbers. In fact it is finite field arithmetic. + /// A prime number must be defined to avoid computation with real numbers. In fact, it is finite field arithmetic. /// The prime number must be the same as used for the construction of shares. /// /// The re-constructed secret. diff --git a/src/Cryptography/SharedSeparator.cs b/src/Cryptography/SharedSeparator.cs index e86345d..06cd59e 100644 --- a/src/Cryptography/SharedSeparator.cs +++ b/src/Cryptography/SharedSeparator.cs @@ -41,5 +41,5 @@ internal static class SharedSeparator /// /// Separator array for method usage to avoid allocation of a new array. /// - internal static readonly char[] CoordinateSeparatorArray = { CoordinateSeparator }; + internal static readonly char[] CoordinateSeparatorArray = [CoordinateSeparator]; } \ No newline at end of file diff --git a/src/Cryptography/Shares.cs b/src/Cryptography/Shares.cs index f774a59..0ea67a9 100644 --- a/src/Cryptography/Shares.cs +++ b/src/Cryptography/Shares.cs @@ -95,12 +95,12 @@ internal Shares(Secret secret, IList> shares) public FinitePoint this[int i] => this.shareList[i]; /// - /// Gets a value indicating whether or not the original secret is available. + /// Gets a value indicating whether the original secret is available. /// public bool OriginalSecretExists => this.OriginalSecret != null; /// - /// Casts a object to a array of s. + /// Casts a object to an array of s. /// /// A object. public static implicit operator string[](Shares shares) => shares?.Select(s => s.ToString()).ToArray(); @@ -118,7 +118,7 @@ internal Shares(Secret secret, IList> shares) public static implicit operator Shares(string s) { var points = s - .Split(new[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries) + .Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries) .Select(line => new FinitePoint(line)) .ToArray(); return new Shares(points); @@ -146,7 +146,7 @@ public static explicit operator FinitePoint[](Shares shares) = /// /// Returns the string representation of the instance. /// - /// A human readable list of shares separated by newlines + /// A human-readable list of shares separated by newlines public override string ToString() { var stringBuilder = new StringBuilder(); @@ -198,7 +198,7 @@ public override string ToString() /// /// Removes all items from the collection. /// - /// This method is implemented. However this method does nothing as long as the property is + /// This method is implemented. However, this method does nothing as long as the property is /// set to . /// The collection is read-only. public void Clear() @@ -215,7 +215,7 @@ public void Clear() /// Adds an to the collection. /// /// The to add to the collection. - /// This method is implemented. However this method does nothing as long as the property is + /// This method is implemented. However, this method does nothing as long as the property is /// set to . /// The collection is read-only. public void Add(FinitePoint item) @@ -236,7 +236,7 @@ public void Add(FinitePoint item) /// /// The to remove from the collection. /// - /// This method is implemented. However this method does nothing as long as the property is + /// This method is implemented. However, this method does nothing as long as the property is /// set to . /// The collection is read-only. public bool Remove(FinitePoint item) diff --git a/src/Math/BigIntCalculator.cs b/src/Math/BigIntCalculator.cs index 10b04bc..f3bd1a9 100644 --- a/src/Math/BigIntCalculator.cs +++ b/src/Math/BigIntCalculator.cs @@ -66,7 +66,7 @@ public BigIntCalculator(byte[] data) : base(new BigInteger(data)) { } public override bool Equals(Calculator other) { var valueLeft = this.Value.ToByteArray(); - var valueRight = other?.Value.ToByteArray() ?? Array.Empty(); + var valueRight = other?.Value.ToByteArray() ?? []; var diff = (uint)valueLeft.Length ^ (uint)valueRight.Length; for (var i = 0; i < valueLeft.Length && i < valueRight.Length; i++) @@ -202,17 +202,17 @@ public override int CompareTo(Calculator other) public override IEnumerable ByteRepresentation => new ReadOnlyCollection(this.Value.ToByteArray()); /// - /// Gets a value indicating whether or not the current object is zero (0). + /// Gets a value indicating whether the current object is zero (0). /// public override bool IsZero => this.Value.IsZero; /// - /// Gets a value indicating whether or not the current object is one (1). + /// Gets a value indicating whether the current object is one (1). /// public override bool IsOne => this.Value.IsOne; /// - /// Gets a value indicating whether or not the current object is an even number. + /// Gets a value indicating whether the current object is an even number. /// public override bool IsEven => this.Value % 2 == 0; diff --git a/src/Math/Calculator.cs b/src/Math/Calculator.cs index 840fbeb..9dbf0e3 100644 --- a/src/Math/Calculator.cs +++ b/src/Math/Calculator.cs @@ -117,7 +117,7 @@ protected static Dictionary> GetDerivedCtors var parameterExpression = Expression.Parameter(paramType); foreach (var childType in ChildTypes) { - var ctorInfo = childType.Value.GetConstructor(new[] {paramType}); + var ctorInfo = childType.Value.GetConstructor([paramType]); if (ctorInfo == null) { continue; diff --git a/src/Math/Calculator`1.cs b/src/Math/Calculator`1.cs index 152076b..2fa503c 100644 --- a/src/Math/Calculator`1.cs +++ b/src/Math/Calculator`1.cs @@ -336,15 +336,12 @@ public override bool Equals(object obj) /// A signed integer that indicates the relationship of the current instance to the parameter public virtual int CompareTo(object obj) { - switch (obj) + return obj switch { - case null: - return 1; - case TNumber number: - return this.CompareTo(number); - default: - throw new ArgumentException(); - } + null => 1, + TNumber number => this.CompareTo(number), + _ => throw new ArgumentException() + }; } /// diff --git a/src/Math/ExtendedGcdResult.cs b/src/Math/ExtendedGcdResult.cs index a4d15b6..f98e6c5 100644 --- a/src/Math/ExtendedGcdResult.cs +++ b/src/Math/ExtendedGcdResult.cs @@ -96,7 +96,7 @@ public bool Equals(ExtendedGcdResult other) => this.Quotients.SequenceE /// if the specified object is equal to the current structure; otherwise . public override bool Equals(object obj) { - return obj != null && this.Equals((ExtendedGcdResult)obj); + return obj is ExtendedGcdResult other && this.Equals(other); } /// diff --git a/src/Math/IExtendedGcdAlgorithm`2.cs b/src/Math/IExtendedGcdAlgorithm`2.cs index 4d6da77..d8346ab 100644 --- a/src/Math/IExtendedGcdAlgorithm`2.cs +++ b/src/Math/IExtendedGcdAlgorithm`2.cs @@ -32,7 +32,7 @@ namespace SecretSharingDotNet.Math; /// -/// Provides mechanism to compute the extended greatest common divisor +/// Provides a mechanism to compute the extended greatest common divisor /// including Bézout coefficients. /// /// Numeric data type (An integer type) @@ -40,10 +40,10 @@ namespace SecretSharingDotNet.Math; public interface IExtendedGcdAlgorithm where TExtendedGcdResult : struct, IExtendedGcdResult { /// - /// Computes, in addition to the greatest common divisor of integers and , also the coefficients of Bézout's identity. + /// Computes, in addition to the greatest common divisor of elements of type and , also the coefficients of Bézout's identity. /// - /// An integer - /// An integer + /// An element of type + /// An element of type /// For details: [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b")] From 59e9b74783d07d044f0f90e8ad4fe15b75a62d5b Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Fri, 30 Aug 2024 22:47:20 +0200 Subject: [PATCH 15/24] GitHub Workflows: Remove .NET 7 setup Resolves: No entry --- .github/workflows/codeql-analysis.yml | 9 ++------- .github/workflows/dotnetall.yml | 9 ++------- .github/workflows/publishing.yml | 9 ++------- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d758a95..f823536 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -44,17 +44,12 @@ jobs: - name: Setup .NET 6 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 6.0.416 - - - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: 7.0.403 + dotnet-version: 6.0.425 - name: Setup .NET 8 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 8.0.100 + dotnet-version: 8.0.401 - name: .NET Core SxS run: | diff --git a/.github/workflows/dotnetall.yml b/.github/workflows/dotnetall.yml index 9388169..312f66e 100644 --- a/.github/workflows/dotnetall.yml +++ b/.github/workflows/dotnetall.yml @@ -21,17 +21,12 @@ jobs: - name: Setup .NET 6 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 6.0.416 - - - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: 7.0.403 + dotnet-version: 6.0.425 - name: Setup .NET 8 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 8.0.100 + dotnet-version: 8.0.401 - name: Restore run: dotnet restore SecretSharingDotNet.sln diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 9af9299..8b7d2e2 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -19,17 +19,12 @@ jobs: - name: Setup .NET 6 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 6.0.416 - - - name: Setup .NET 7 - uses: actions/setup-dotnet@v4.0.1 - with: - dotnet-version: 7.0.403 + dotnet-version: 6.0.425 - name: Setup .NET 8 uses: actions/setup-dotnet@v4.0.1 with: - dotnet-version: 8.0.100 + dotnet-version: 8.0.401 - name: Decrypt large secret run: ./.github/secrets/decrypt_publisher_snk.sh From 321fca47c1bbd442f1ee7ffc3a00f637238444e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 13:29:28 +0000 Subject: [PATCH 16/24] Bump Microsoft.TestPlatform.ObjectModel from 17.11.0 to 17.11.1 Bumps [Microsoft.TestPlatform.ObjectModel](https://github.com/microsoft/vstest) from 17.11.0 to 17.11.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.11.0...v17.11.1) --- updated-dependencies: - dependency-name: Microsoft.TestPlatform.ObjectModel dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 4e20b70..5815fad 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -12,7 +12,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive From 4e34ca68651a54a1e2f719945849fdc412bc68fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:11:09 +0000 Subject: [PATCH 17/24] Bump Microsoft.NET.Test.Sdk from 17.11.0 to 17.11.1 Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.11.0 to 17.11.1. - [Release notes](https://github.com/microsoft/vstest/releases) - [Changelog](https://github.com/microsoft/vstest/blob/main/docs/releases.md) - [Commits](https://github.com/microsoft/vstest/compare/v17.11.0...v17.11.1) --- updated-dependencies: - dependency-name: Microsoft.NET.Test.Sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 5815fad..93ad450 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -11,7 +11,7 @@ - + From a3577554529842b0b7e896f62cab7bba13c87636 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 13:30:12 +0000 Subject: [PATCH 18/24] Bump xunit from 2.9.0 to 2.9.1 Bumps [xunit](https://github.com/xunit/xunit) from 2.9.0 to 2.9.1. - [Commits](https://github.com/xunit/xunit/compare/2.9.0...2.9.1) --- updated-dependencies: - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 93ad450..f61e385 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From c58b6666225040444687628d03916902a12f90b5 Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Sun, 22 Sep 2024 19:04:33 +0200 Subject: [PATCH 19/24] Refactor visibility and syntax in Calculator classes Update method visibility from public to protected in BigIntCalculator and Calculator`1 classes to restrict access. Also, fix method call syntax for Sqrt in FinitePoint`1 and improve null checks in operator overloads. Resolves: No entry --- CHANGELOG.md | 4 ++ src/Cryptography/FinitePoint`1.cs | 2 +- src/Cryptography/Secret`1.cs | 2 +- src/Math/BigIntCalculator.cs | 61 +++++++++++++++---------------- src/Math/Calculator`1.cs | 50 +++++++++++++------------ 5 files changed, 62 insertions(+), 57 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 574bf03..07fd6df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added use-case interfaces `IMakeSharesUseCase` and `IReconstructUseCase` to the `SecretSharingDotNet` project. - Added a guide to the `README.md` file on how to use the use-case interfaces with dependency injection. +### Changed +- Changed the `Sqrt` signature in the `BigIntCalculator` class from property to method. +- Changed method visibility from `public` to `protected` in the `BigIntCalculator`and `Calculator` classes to restrict access. + ### Removed - Removed .NET 7 support, because it retires on May 14, 2024. See [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). diff --git a/src/Cryptography/FinitePoint`1.cs b/src/Cryptography/FinitePoint`1.cs index eb97fb7..354cfe1 100644 --- a/src/Cryptography/FinitePoint`1.cs +++ b/src/Cryptography/FinitePoint`1.cs @@ -192,7 +192,7 @@ public FinitePoint(Calculator x, Calculator y) /// public int CompareTo(FinitePoint other) { - return ((this.X.Pow(2) + this.Y.Pow(2)).Sqrt - (other.X.Pow(2) + other.Y.Pow(2)).Sqrt).Sign; + return ((this.X.Pow(2) + this.Y.Pow(2)).Sqrt() - (other.X.Pow(2) + other.Y.Pow(2)).Sqrt()).Sign; } /// diff --git a/src/Cryptography/Secret`1.cs b/src/Cryptography/Secret`1.cs index dcd5897..f89d561 100644 --- a/src/Cryptography/Secret`1.cs +++ b/src/Cryptography/Secret`1.cs @@ -307,7 +307,7 @@ public bool Equals(Secret other) /// /// Converts the value of structure to its equivalent representation - /// that is unicode encoded. + /// that is Unicode encoded. /// /// representation of public override string ToString() diff --git a/src/Math/BigIntCalculator.cs b/src/Math/BigIntCalculator.cs index f3bd1a9..0820e97 100644 --- a/src/Math/BigIntCalculator.cs +++ b/src/Math/BigIntCalculator.cs @@ -82,28 +82,28 @@ public override bool Equals(Calculator other) /// /// right-hand operand /// This method returns if this instance is greater than the instance, otherwise. - public override bool GreaterThan(BigInteger right) => this.Value > right; + protected override bool GreaterThan(BigInteger right) => this.Value > right; /// /// This method represents the Lower Than operator. /// /// right-hand operand /// This method returns if this instance is less than the instance, otherwise. - public override bool LowerThan(BigInteger right) => this.Value < right; + protected override bool LowerThan(BigInteger right) => this.Value < right; /// /// This method represents the Greater Than Or Equal To operator. /// /// right-hand operand /// This method returns if this instance is greater than or equal to the instance, otherwise. - public override bool EqualOrGreaterThan(BigInteger right) => this.Value >= right; + protected override bool EqualOrGreaterThan(BigInteger right) => this.Value >= right; /// /// This method represents the Lower Than Or Equal To operator. /// /// right-hand operand /// This method returns if this instance is less than or equal to the instance, otherwise. - public override bool EqualOrLowerThan(BigInteger right) => this.Value <= right; + protected override bool EqualOrLowerThan(BigInteger right) => this.Value <= right; /// /// Unable to convert the current instance of class to . @@ -127,7 +127,7 @@ public override int CompareTo(Calculator other) /// Right value to add (right summand). /// The sum of the current instance and the /// instance. - public override Calculator Add(BigInteger right) => this.Value + right; + protected override Calculator Add(BigInteger right) => this.Value + right; /// /// Subtracts the current instance with the @@ -136,7 +136,7 @@ public override int CompareTo(Calculator other) /// Right value to subtract (subtrahend). /// The difference of the current instance and the /// instance. - public override Calculator Subtract(BigInteger right) => this.Value - right; + protected override Calculator Subtract(BigInteger right) => this.Value - right; /// /// Multiplies the current instance with the @@ -145,7 +145,7 @@ public override int CompareTo(Calculator other) /// multiplicand /// The product of the current instance and the /// instance. - public override Calculator Multiply(BigInteger right) => this.Value * right; + protected override Calculator Multiply(BigInteger right) => this.Value * right; /// /// Divides the current instance with the @@ -154,26 +154,26 @@ public override int CompareTo(Calculator other) /// divisor /// The quotient of the current instance and the /// instance. - public override Calculator Divide(BigInteger right) => this.Value / right; + protected override Calculator Divide(BigInteger right) => this.Value / right; /// /// The modulo operation /// /// divisor /// The remainder as instance. - public override Calculator Modulo(BigInteger right) => this.Value % right; + protected override Calculator Modulo(BigInteger right) => this.Value % right; /// /// The unary increment method increments this instance by 1. /// /// This instance plus - public override Calculator Increment() => ++this.Clone().Value; + protected override Calculator Increment() => ++this.Clone().Value; /// /// The unary decrement method decrements this instance by 1. /// /// This instance minus - public override Calculator Decrement() => --this.Clone().Value; + protected override Calculator Decrement() => --this.Clone().Value; /// /// Returns the absolute value of the current object. @@ -225,30 +225,27 @@ public override int CompareTo(Calculator other) /// Returns the square root of the current object. /// /// NaN (value is lower than zero) - public override Calculator Sqrt + public override Calculator Sqrt() { - get + if (this.Value == BigInteger.Zero) { - if (this.Value == BigInteger.Zero) - { - return Zero; - } - - if (this.Value < BigInteger.Zero) - { - throw new ArithmeticException("NaN"); - } - - int bitLength = Convert.ToInt32(Math.Ceiling(BigInteger.Log(this.Value, 2))); - var root = BigInteger.One << (bitLength >> 1); - bool IsSqrt(BigInteger n, BigInteger r) => n >= r * r && n < (r + 1) * (r + 1); - while (!IsSqrt(this.Value, root)) - { - root = root + this.Value / root >> 1; - } - - return root; + return Zero; } + + if (this.Value < BigInteger.Zero) + { + throw new ArithmeticException("NaN"); + } + + int bitLength = Convert.ToInt32(Math.Ceiling(BigInteger.Log(this.Value, 2))); + var root = BigInteger.One << (bitLength >> 1); + bool IsSqrt(BigInteger n, BigInteger r) => n >= r * r && n < (r + 1) * (r + 1); + while (!IsSqrt(this.Value, root)) + { + root = root + this.Value / root >> 1; + } + + return root; } /// diff --git a/src/Math/Calculator`1.cs b/src/Math/Calculator`1.cs index 2fa503c..a5a773a 100644 --- a/src/Math/Calculator`1.cs +++ b/src/Math/Calculator`1.cs @@ -39,7 +39,11 @@ namespace SecretSharingDotNet.Math; /// implementation from the concrete numeric data type like BigInteger. /// /// Numeric data type -public abstract class Calculator : Calculator, IEquatable>, IComparable, IComparable> +public abstract class Calculator : + Calculator, + IEquatable>, + IComparable, + IComparable> { /// /// Saves a dictionary of constructors of number data types derived from the class. @@ -59,7 +63,7 @@ public abstract class Calculator : Calculator, IEquatableRight value to add (right summand). /// The sum of the current instance and the /// instance. - public abstract Calculator Add(TNumber right); + protected abstract Calculator Add(TNumber right); /// /// Subtracts the current instance with the @@ -68,7 +72,7 @@ public abstract class Calculator : Calculator, IEquatableRight value to subtract (subtrahend). /// The difference of the current instance and the /// instance. - public abstract Calculator Subtract(TNumber right); + protected abstract Calculator Subtract(TNumber right); /// /// Multiplies the current instance with the @@ -77,7 +81,7 @@ public abstract class Calculator : Calculator, IEquatablemultiplicand /// The product of the current instance and the /// instance. - public abstract Calculator Multiply(TNumber right); + protected abstract Calculator Multiply(TNumber right); /// /// Divides the current instance with the @@ -86,26 +90,26 @@ public abstract class Calculator : Calculator, IEquatabledivisor /// The quotient of the current instance and the /// instance. - public abstract Calculator Divide(TNumber right); + protected abstract Calculator Divide(TNumber right); /// /// The modulo operation /// /// divisor /// The remainder - public abstract Calculator Modulo(TNumber right); + protected abstract Calculator Modulo(TNumber right); /// /// The unary increment method increments this instance by 1. /// /// This instance plus - public abstract Calculator Increment(); + protected abstract Calculator Increment(); /// /// The unary decrement method decrements this instance by 1. /// /// This instance minus - public abstract Calculator Decrement(); + protected abstract Calculator Decrement(); /// /// Returns the absolute value of the current object. @@ -123,35 +127,35 @@ public abstract class Calculator : Calculator, IEquatable /// Returns the square root of the current . /// - public abstract Calculator Sqrt { get; } + public abstract Calculator Sqrt(); /// /// This method represents the Greater Than operator. /// /// right-hand operand /// This method returns if this instance is greater than the instance, otherwise. - public abstract bool GreaterThan(TNumber right); + protected abstract bool GreaterThan(TNumber right); /// /// This method represents the Greater Than Or Equal To operator. /// /// right-hand operand /// This method returns if this instance is greater than or equal to the instance, otherwise. - public abstract bool EqualOrGreaterThan(TNumber right); + protected abstract bool EqualOrGreaterThan(TNumber right); /// /// This method represents the Lower Than operator. /// /// right-hand operand /// This method returns if this instance is less than the instance, otherwise. - public abstract bool LowerThan(TNumber right); + protected abstract bool LowerThan(TNumber right); /// /// This method represents the Lower Than Or Equal To operator. /// /// right-hand operand /// This method returns if this instance is less than or equal to the instance, otherwise. - public abstract bool EqualOrLowerThan(TNumber right); + protected abstract bool EqualOrLowerThan(TNumber right); /// /// Greater than operator @@ -159,7 +163,7 @@ public abstract class Calculator : Calculator, IEquatableThe 1st operand /// The 2nd operand /// Returns if its 1st operand is greater than its 2nd operand, otherwise . - public static bool operator >(Calculator left, Calculator right) => !(left is null) && !(right is null) && left.GreaterThan(right.Value); + public static bool operator >(Calculator left, Calculator right) => left is not null && right is not null && left.GreaterThan(right.Value); /// /// Less than operator @@ -167,7 +171,7 @@ public abstract class Calculator : Calculator, IEquatableThe 1st operand /// The 2nd operand /// Returns if its 1st operand is less than its 2nd operand, otherwise . - public static bool operator <(Calculator left, Calculator right) => !(left is null) && !(right is null) && left.LowerThan(right.Value); + public static bool operator <(Calculator left, Calculator right) => left is not null && right is not null && left.LowerThan(right.Value); /// /// Greater than or equal operator @@ -175,7 +179,7 @@ public abstract class Calculator : Calculator, IEquatableThe 1st operand /// The 2nd operand /// Returns if its 1st operand is greater than or equal to its 2nd operand, otherwise . - public static bool operator >=(Calculator left, Calculator right) => !(left is null) && !(right is null) && left.EqualOrGreaterThan(right.Value); + public static bool operator >=(Calculator left, Calculator right) => left is not null && right is not null && left.EqualOrGreaterThan(right.Value); /// /// Less than or equal operator @@ -183,7 +187,7 @@ public abstract class Calculator : Calculator, IEquatableThe 1st operand /// The 2nd operand /// Returns if its 1st operand is less than or equal to its 2nd operand, otherwise . - public static bool operator <=(Calculator left, Calculator right) => !(left is null) && !(right is null) && left.EqualOrLowerThan(right.Value); + public static bool operator <=(Calculator left, Calculator right) => left is not null && right is not null && left.EqualOrLowerThan(right.Value); /// /// Addition operation @@ -191,7 +195,7 @@ public abstract class Calculator : Calculator, IEquatableThe 1st summand /// The 2nd summand /// The sum - public static Calculator operator +(Calculator left, Calculator right) => !(right is null) ? left?.Add(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); + public static Calculator operator +(Calculator left, Calculator right) => right is not null ? left?.Add(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); /// /// Subtraction operation @@ -199,7 +203,7 @@ public abstract class Calculator : Calculator, IEquatableThe minuend /// The subtrahend /// The difference - public static Calculator operator -(Calculator left, Calculator right) => !(right is null) ? left?.Subtract(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); + public static Calculator operator -(Calculator left, Calculator right) => right is not null ? left?.Subtract(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); /// /// Multiplication operation @@ -207,7 +211,7 @@ public abstract class Calculator : Calculator, IEquatablemultiplier /// multiplicand /// The product - public static Calculator operator *(Calculator left, Calculator right) => !(right is null) ? left?.Multiply(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); + public static Calculator operator *(Calculator left, Calculator right) => right is not null ? left?.Multiply(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); /// /// Divide operation @@ -215,7 +219,7 @@ public abstract class Calculator : Calculator, IEquatabledividend /// divisor /// The quotient - public static Calculator operator /(Calculator left, Calculator right) => !(right is null) ? left?.Divide(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); + public static Calculator operator /(Calculator left, Calculator right) => right is not null ? left?.Divide(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); /// /// Modulo operation @@ -223,7 +227,7 @@ public abstract class Calculator : Calculator, IEquatabledividend /// divisor /// The remainder - public static Calculator operator %(Calculator left, Calculator right) => !(right is null) ? left?.Modulo(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); + public static Calculator operator %(Calculator left, Calculator right) => right is not null ? left?.Modulo(right.Value) ?? throw new ArgumentNullException(nameof(left)) : throw new ArgumentNullException(nameof(right)); /// /// Increment operator @@ -275,7 +279,7 @@ public abstract class Calculator : Calculator, IEquatable instance to an instance. /// /// A data type from basic class . - public static implicit operator TNumber(Calculator calculatorInstance) => !(calculatorInstance is null) ? calculatorInstance.Value : default; + public static implicit operator TNumber(Calculator calculatorInstance) => calculatorInstance is not null ? calculatorInstance.Value : default; /// /// Casts the instance to an instance. From 71225a68c733be24e509fbc758a0ad0f48848320 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:45:51 +0000 Subject: [PATCH 20/24] Bump actions/setup-dotnet from 4.0.1 to 4.1.0 Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4.0.1 to 4.1.0. - [Release notes](https://github.com/actions/setup-dotnet/releases) - [Commits](https://github.com/actions/setup-dotnet/compare/v4.0.1...v4.1.0) --- updated-dependencies: - dependency-name: actions/setup-dotnet dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql-analysis.yml | 4 ++-- .github/workflows/dotnetall.yml | 4 ++-- .github/workflows/publishing.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index f823536..2110fea 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -42,12 +42,12 @@ jobs: uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 6.0.425 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 8.0.401 diff --git a/.github/workflows/dotnetall.yml b/.github/workflows/dotnetall.yml index 312f66e..7e27b8b 100644 --- a/.github/workflows/dotnetall.yml +++ b/.github/workflows/dotnetall.yml @@ -19,12 +19,12 @@ jobs: - uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 6.0.425 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 8.0.401 diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 8b7d2e2..bb87cc2 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -17,12 +17,12 @@ jobs: - uses: actions/checkout@v4 - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 6.0.425 - name: Setup .NET 8 - uses: actions/setup-dotnet@v4.0.1 + uses: actions/setup-dotnet@v4.1.0 with: dotnet-version: 8.0.401 From 4e4df8509d488b5462b3f62442eec04898969951 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 17 Nov 2024 16:04:32 +0000 Subject: [PATCH 21/24] Bump Microsoft.NETFramework.ReferenceAssemblies and xunit Bumps [Microsoft.NETFramework.ReferenceAssemblies](https://github.com/Microsoft/dotnet) and [xunit](https://github.com/xunit/xunit). These dependencies needed to be updated together. Updates `Microsoft.NETFramework.ReferenceAssemblies` from 1.0.3 to 1.0.3 - [Commits](https://github.com/Microsoft/dotnet/commits) Updates `xunit` from 2.9.1 to 2.9.2 - [Commits](https://github.com/xunit/xunit/compare/v2-2.9.1...v2-2.9.2) --- updated-dependencies: - dependency-name: Microsoft.NETFramework.ReferenceAssemblies dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: xunit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- tests/SecretSharingDotNetTest.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index f61e385..d012a29 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -13,7 +13,7 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all From 1cbe2439624cc428112408783395422bf56397dc Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Sun, 17 Nov 2024 18:13:20 +0100 Subject: [PATCH 22/24] .NET 6 Support: Removed Removed .NET 6 support, because it retires on November 14, 2024. See https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core Resolves: No entry --- .github/workflows/codeql-analysis.yml | 9 ++------- .github/workflows/dotnetall.yml | 7 +------ .github/workflows/publishing.yml | 7 +------ CHANGELOG.md | 1 + README.md | 18 ++++++------------ src/SecretSharingDotNet.csproj | 2 +- tests/SecretSharingDotNetTest.csproj | 2 +- 7 files changed, 13 insertions(+), 33 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 2110fea..6dc6577 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -41,19 +41,14 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.1.0 - with: - dotnet-version: 6.0.425 - - name: Setup .NET 8 uses: actions/setup-dotnet@v4.1.0 with: - dotnet-version: 8.0.401 + dotnet-version: 8.0.404 - name: .NET Core SxS run: | - rsync -a ${DOTNET_ROOT/8.0.100/7.0.403/6.0.416}/* $DOTNET_ROOT/ + rsync -a ${DOTNET_ROOT/8.0.404}/* $DOTNET_ROOT/ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dotnetall.yml b/.github/workflows/dotnetall.yml index 7e27b8b..b0f765d 100644 --- a/.github/workflows/dotnetall.yml +++ b/.github/workflows/dotnetall.yml @@ -18,15 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.1.0 - with: - dotnet-version: 6.0.425 - - name: Setup .NET 8 uses: actions/setup-dotnet@v4.1.0 with: - dotnet-version: 8.0.401 + dotnet-version: 8.0.404 - name: Restore run: dotnet restore SecretSharingDotNet.sln diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index bb87cc2..638a214 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -16,15 +16,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Setup .NET 6 - uses: actions/setup-dotnet@v4.1.0 - with: - dotnet-version: 6.0.425 - - name: Setup .NET 8 uses: actions/setup-dotnet@v4.1.0 with: - dotnet-version: 8.0.401 + dotnet-version: 8.0.404 - name: Decrypt large secret run: ./.github/secrets/decrypt_publisher_snk.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 07fd6df..5f16a5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - Removed .NET 7 support, because it retires on May 14, 2024. See [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). +- Removed .NET 6 support, because it retires on November 12, 2024. See [.NET and .NET Core Support Policy](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core). ## [0.11.0] - 2023-12-30 ### Added diff --git a/README.md b/README.md index deb3b57..0f99b76 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ An C# implementation of Shamir's Secret Sharing. - Build status + Build status SecretSharingDotNet.sln - SDK + SDK Standard 2.0 @@ -36,9 +36,6 @@ An C# implementation of Shamir's Secret Sharing. FX 4.8 - - .NET 6 - .NET 8 @@ -58,9 +55,9 @@ An C# implementation of Shamir's Secret Sharing. - SecretSharingDotNet NuGet - NuGet Version 0.11.0 - Tag + SecretSharingDotNet NuGet + NuGet Version 0.11.0 + Tag Standard 2.0 @@ -81,9 +78,6 @@ An C# implementation of Shamir's Secret Sharing. FX 4.8 - - .NET 6 - .NET 8 @@ -441,7 +435,7 @@ You can find the Mono installation instructions [here](https://www.mono-project. The .NET Frameworks 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 and 4.8.1 can be found [here](https://dotnet.microsoft.com/download/dotnet-framework). -The .NET SDKs 6.0, 7.0 and 8.0 can be found [here](https://dotnet.microsoft.com/download/dotnet). +The .NET SDK 8.0 can be found [here](https://dotnet.microsoft.com/download/dotnet). ## Build and test the solution You can use the `SecretSharingDotNet.sln` solution file with the `dotnet` command to build the [SecretSharingDotNet](#secretsharingdotnet) library in the `Debug` or `Release` configuration. You can also use the `dotnet` command to start the unit tests. diff --git a/src/SecretSharingDotNet.csproj b/src/SecretSharingDotNet.csproj index 85d9089..8591a31 100644 --- a/src/SecretSharingDotNet.csproj +++ b/src/SecretSharingDotNet.csproj @@ -5,7 +5,7 @@ SecretSharingDotNet Library latest - netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net6.0;net8.0 + netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net8.0 SecretSharingDotNet.snk True false diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index d012a29..3eeeff4 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -2,7 +2,7 @@ latest - net462;net47;net471;net472;net48;net481;net6.0;net8.0 + net462;net47;net471;net472;net48;net481;net8.0 ..\src\SecretSharingDotNet.snk True false From fca5e026c1174bd6c24f52235e61038bbd71413f Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Sun, 17 Nov 2024 18:33:31 +0100 Subject: [PATCH 23/24] .NET 9 Support: Added Resolves: No entry --- .github/workflows/codeql-analysis.yml | 7 ++++++- .github/workflows/dotnetall.yml | 5 +++++ .github/workflows/publishing.yml | 5 +++++ CHANGELOG.md | 1 + README.md | 18 ++++++++++++------ src/SecretSharingDotNet.csproj | 2 +- tests/SecretSharingDotNetTest.csproj | 2 +- 7 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6dc6577..c99b30a 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -46,9 +46,14 @@ jobs: with: dotnet-version: 8.0.404 + - name: Setup .NET 9 + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: 9.0.100 + - name: .NET Core SxS run: | - rsync -a ${DOTNET_ROOT/8.0.404}/* $DOTNET_ROOT/ + rsync -a ${DOTNET_ROOT/8.0.404/9.0.100}/* $DOTNET_ROOT/ # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dotnetall.yml b/.github/workflows/dotnetall.yml index b0f765d..3b9c522 100644 --- a/.github/workflows/dotnetall.yml +++ b/.github/workflows/dotnetall.yml @@ -23,6 +23,11 @@ jobs: with: dotnet-version: 8.0.404 + - name: Setup .NET 9 + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: 9.0.100 + - name: Restore run: dotnet restore SecretSharingDotNet.sln diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 638a214..78f9eca 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -21,6 +21,11 @@ jobs: with: dotnet-version: 8.0.404 + - name: Setup .NET 9 + uses: actions/setup-dotnet@v4.1.0 + with: + dotnet-version: 9.0.100 + - name: Decrypt large secret run: ./.github/secrets/decrypt_publisher_snk.sh env: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f16a5f..7d46dac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Added .NET 9.0 support - Added use-case interfaces `IMakeSharesUseCase` and `IReconstructUseCase` to the `SecretSharingDotNet` project. - Added a guide to the `README.md` file on how to use the use-case interfaces with dependency injection. diff --git a/README.md b/README.md index 0f99b76..440cdfc 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ An C# implementation of Shamir's Secret Sharing. - Build status + Build status SecretSharingDotNet.sln - SDK + SDK Standard 2.0 @@ -39,6 +39,9 @@ An C# implementation of Shamir's Secret Sharing. .NET 8 + + .NET 9 + @@ -55,9 +58,9 @@ An C# implementation of Shamir's Secret Sharing. - SecretSharingDotNet NuGet - NuGet Version 0.11.0 - Tag + SecretSharingDotNet NuGet + NuGet Version 0.11.0 + Tag Standard 2.0 @@ -81,6 +84,9 @@ An C# implementation of Shamir's Secret Sharing. .NET 8 + + .NET 9 + @@ -435,7 +441,7 @@ You can find the Mono installation instructions [here](https://www.mono-project. The .NET Frameworks 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8 and 4.8.1 can be found [here](https://dotnet.microsoft.com/download/dotnet-framework). -The .NET SDK 8.0 can be found [here](https://dotnet.microsoft.com/download/dotnet). +The .NET SDKs 8.0 and 9.0 can be found [here](https://dotnet.microsoft.com/download/dotnet). ## Build and test the solution You can use the `SecretSharingDotNet.sln` solution file with the `dotnet` command to build the [SecretSharingDotNet](#secretsharingdotnet) library in the `Debug` or `Release` configuration. You can also use the `dotnet` command to start the unit tests. diff --git a/src/SecretSharingDotNet.csproj b/src/SecretSharingDotNet.csproj index 8591a31..4239d75 100644 --- a/src/SecretSharingDotNet.csproj +++ b/src/SecretSharingDotNet.csproj @@ -5,7 +5,7 @@ SecretSharingDotNet Library latest - netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net8.0 + netstandard2.0;netstandard2.1;net462;net47;net471;net472;net48;net481;net8.0;net9.0 SecretSharingDotNet.snk True false diff --git a/tests/SecretSharingDotNetTest.csproj b/tests/SecretSharingDotNetTest.csproj index 3eeeff4..f32a2f9 100644 --- a/tests/SecretSharingDotNetTest.csproj +++ b/tests/SecretSharingDotNetTest.csproj @@ -2,7 +2,7 @@ latest - net462;net47;net471;net472;net48;net481;net8.0 + net462;net47;net471;net472;net48;net481;net8.0;net9.0 ..\src\SecretSharingDotNet.snk True false From 2412d053942c85429f88a2df3d3bdd605a1b73dc Mon Sep 17 00:00:00 2001 From: Sebastian Walther Date: Sun, 17 Nov 2024 18:48:03 +0100 Subject: [PATCH 24/24] Bump version: [v0.12.0] Resolves: No entry --- CHANGELOG.md | 5 +++-- README.md | 12 ++++++------ src/Properties/AssemblyInfo.cs | 4 ++-- src/SecretSharingDotNet.csproj | 4 ++-- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d46dac..ae34c92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [0.12.0] - 2024-11-17 ### Added - Added .NET 9.0 support - Added use-case interfaces `IMakeSharesUseCase` and `IReconstructUseCase` to the `SecretSharingDotNet` project. @@ -220,7 +220,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `LICENSE.md` - Added `README.md` -[Unreleased]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.11.0...develop +[Unreleased]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.12.0...develop +[0.12.0]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.11.0...v0.12.0 [0.11.0]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.10.2...v0.11.0 [0.10.2]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.10.1...v0.10.2 [0.10.1]: https://github.com/shinji-san/SecretSharingDotNet/compare/v0.10.0...v0.10.1 diff --git a/README.md b/README.md index 440cdfc..5faa531 100644 --- a/README.md +++ b/README.md @@ -58,9 +58,9 @@ An C# implementation of Shamir's Secret Sharing. - SecretSharingDotNet NuGet - NuGet Version 0.11.0 - Tag + SecretSharingDotNet NuGet + NuGet Version 0.12.0 + Tag Standard 2.0 @@ -94,10 +94,10 @@ An C# implementation of Shamir's Secret Sharing. 1. Open a console and switch to the directory, containing your project file. -2. Use the following command to install version 0.11.0 of the SecretSharingDotNet package: +2. Use the following command to install version 0.12.0 of the SecretSharingDotNet package: ```dotnetcli - dotnet add package SecretSharingDotNet -v 0.11.0 -f + dotnet add package SecretSharingDotNet -v 0.12.0 -f ``` 3. After the completion of the command, look at the project file to make sure that the package is successfully installed. @@ -106,7 +106,7 @@ An C# implementation of Shamir's Secret Sharing. ```xml - + ``` ## Remove SecretSharingDotNet package diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index 23ebac5..f581d62 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -15,8 +15,8 @@ [assembly: Guid("1c21b99c-2de4-4ca5-b4ce-bc95cf89369e")] -[assembly: AssemblyVersion("0.11.0")] -[assembly: AssemblyFileVersion("0.11.0")] +[assembly: AssemblyVersion("0.12.0")] +[assembly: AssemblyFileVersion("0.12.0")] [assembly: NeutralResourcesLanguage("en")] [assembly: System.CLSCompliant(true)] diff --git a/src/SecretSharingDotNet.csproj b/src/SecretSharingDotNet.csproj index 4239d75..ee9ab1e 100644 --- a/src/SecretSharingDotNet.csproj +++ b/src/SecretSharingDotNet.csproj @@ -11,14 +11,14 @@ false SecretSharingDotNet MIT - Changelog: https://github.com/shinji-san/SecretSharingDotNet/blob/v0.11.0/CHANGELOG.md + Changelog: https://github.com/shinji-san/SecretSharingDotNet/blob/v0.12.0/CHANGELOG.md An C# implementation of Shamir's Secret Sharing README.md secret sharing;shamir secret sharing;cryptography https://github.com/shinji-san/SecretSharingDotNet https://github.com/shinji-san/SecretSharingDotNet git - 0.11.0 + 0.12.0 Sebastian Walther Private Person true