You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #70 from shinji-san/release-v0.7.0
Release v0.7.0
Added
- Added implicit casts for byte arrays in Secret class.
- Added legacy mode. See README.md, section "Usage" for more details.
Changed
- Changed behavior of Secret class for negative secret values.
- Changed calculation of maximum security level in Reconstruction method.
Fixed
- Fixed reopened bug #60 "Reconstruction fails at random".
- Fixed assembly output path in SecretSharingDotNetFx4.6.2.csproj
Removed
- Removed .NET FX 4.5.2 support, because it retires on April 26, 2022.
- Removed .NET FX 4.6 support, because it retires on April 26, 2022.
- Removed .NET FX 4.6.1 support, because it retires on April 26, 2022.
Copy file name to clipboardexpand all lines: CHANGELOG.md
+18
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.
4
4
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
+
## [0.7.0] - 2022-02-09
8
+
### Added
9
+
- Added implicit casts for byte arrays in *Secret* class.
10
+
- Added legacy mode. See README.md, section "Usage" for more details.
11
+
12
+
### Changed
13
+
- Changed behavior of *Secret* class for negative secret values. See README.md, section "Usage" and bug report [#60](https://github.com/shinji-san/SecretSharingDotNet/issues/60) for more details.
14
+
- Changed calculation of maximum security level in Reconstruction method.
15
+
16
+
### Fixed
17
+
- Fixed reopened bug [#60](https://github.com/shinji-san/SecretSharingDotNet/issues/60) "Reconstruction fails at random".
18
+
- Fixed assembly output path in `SecretSharingDotNetFx4.6.2.csproj`
19
+
20
+
### Removed
21
+
- Removed .NET FX 4.5.2 support, because it retires on April 26, 2022. See [.NET FX Lifecycle Policy](https://docs.microsoft.com/en-us/lifecycle/products/microsoft-net-framework).
22
+
- Removed .NET FX 4.6 support, because it retires on April 26, 2022. See [.NET FX Lifecycle Policy](https://docs.microsoft.com/en-us/lifecycle/products/microsoft-net-framework).
23
+
- Removed .NET FX 4.6.1 support, because it retires on April 26, 2022. See [.NET FX Lifecycle Policy](https://docs.microsoft.com/en-us/lifecycle/products/microsoft-net-framework).
@@ -174,6 +156,73 @@ Afterwards, use the function `Reconstruction` to re-construct the original secre
174
156
175
157
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.
176
158
159
+
## Attention: Breaking change - Normal and legacy mode in v0.7.0
160
+
161
+
Library version 0.7.0 introduces a normal mode and a legacy mode for secrets. The normal mode is the new and default mode. The legacy mode is for backward compatibility.
162
+
163
+
*Why was the normal mode introduced?*
164
+
165
+
The normal mode supports positive secret values and also negative secret values like negative integer numbers or byte arrays with most significant byte greater than 0x7F. The legacy mode generates shares that can't be used to reconstruct negative secret values. So the original secret and the reconstructed secret aren't identical for negative secret values (e.g. `BigInetger secret = -2000`). The legacy mode only returns correct results for positive secret values.
* Shares generated with v0.7.0 or later *can* be used with v0.6.0 or earlier to reconstruct the secret.
175
+
* Shares generated with v0.6.0 or earlier *can* be used with v0.7.0 or later to reconstruct the secret.
176
+
* This mode supports security level 5 as minimum.
177
+
178
+
A mixed mode is not possible. It is recommended to reconstruct the secret with the old procedure and to split again with the new procedure.
179
+
180
+
The legacy mode is thread-safe, but not task-safe.
181
+
182
+
For further details see the example below:
183
+
184
+
```csharp
185
+
using System;
186
+
using System.Collections.Generic;
187
+
using System.Linq;
188
+
using System.Numerics;
189
+
190
+
using SecretSharingDotNet.Cryptography;
191
+
using SecretSharingDotNet.Math;
192
+
193
+
namespace LegacyModeExample
194
+
{
195
+
public class Program
196
+
{
197
+
public static void Main(string[] args)
198
+
{
199
+
//// Legacy mode on / normal mode off
200
+
Secret.LegacyMode.Value = true
201
+
try
202
+
{
203
+
var gcd = new ExtendedEuclideanAlgorithm<BigInteger>();
204
+
205
+
var split = new ShamirsSecretSharing<BigInteger>(gcd);
206
+
207
+
string password = "Hello World!!";
208
+
209
+
var shares = split.MakeShares(3, 7, password);
210
+
211
+
var combine = new ShamirsSecretSharing<BigInteger>(gcd);
212
+
var subSet = shares.Where(p => p.X.IsEven).ToList();
213
+
var recoveredSecret = combine.Reconstruction(subSet.ToArray());
214
+
215
+
}
216
+
finally
217
+
{
218
+
//// Legacy mode off / normal mode on
219
+
Secret.LegacyMode.Value = false
220
+
}
221
+
}
222
+
}
223
+
}
224
+
```
225
+
177
226
## Random secret
178
227
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:
179
228
```csharp
@@ -339,25 +388,25 @@ dotnet test -c Debug SecretSharingDotNet5.sln
339
388
dotnet test -c Release SecretSharingDotNet5.sln
340
389
```
341
390
342
-
## Using MSBuild to build for .NET FX 4.5.2
391
+
## Using MSBuild to build for .NET FX 4.6.2
343
392
Use one of the following solutions with `msbuild` to build [SecretSharingDotNet](#secretsharingdotnet):
344
-
*`SecretSharingDotNetFx4.5.2.sln`
393
+
*`SecretSharingDotNetFx4.6.2.sln`
345
394
346
395
Currently unit testing with MSBuild isn't possible.
0 commit comments