Skip to content

Commit

Permalink
Merge pull request #159 from shinji-san/patch-ObsoleteSecretLegacyMode
Browse files Browse the repository at this point in the history
Patch - Secret Legacy Mode is marked as deprecated

Resolves: #159
  • Loading branch information
shinji-san authored Sep 16, 2023
2 parents ebc5f84 + c994212 commit 49fe87b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- FinitePoint: Use `ReadOnlySpan<char>` for `string` parameters in ctor and methods.

### Deprecated
- The Secret Legacy Mode is marked as deprecated and will be removed in one of the next releases.

## [0.10.1] - 2023-05-08
### Fixed
- Fixed BigIntCalculator's Equals method to avoid timing attacks. The slow equal implementation is used now.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Afterwards, use the function `Reconstruction` to re-construct the original secre
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.
## Attention: Breaking change - Normal and legacy mode in v0.7.0
## Attention: Breaking change - Normal and legacy mode in v0.7.0 [Deprecated]
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.
Expand Down
2 changes: 2 additions & 0 deletions src/Cryptography/Secret.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public class Secret
/// Gets or sets the legacy mode on (<see langword="true"/>) or <see langword="off"/> to be compatible with
/// v0.6.0 or older.
/// </summary>
[Obsolete("Legacy mode is deprecated and will be removed in the next versions.")]
public static readonly ThreadLocal<bool> LegacyMode = new ThreadLocal<bool> {Value = false};

/// <summary>
Expand Down Expand Up @@ -118,6 +119,7 @@ internal static Secret<TNumber> CreateRandom<TNumber>(Calculator<TNumber> prime)
/// <summary>
/// Creates an array from a base64 string as in version 0.6.0 or older
/// </summary>
[Obsolete("Legacy mode is deprecated and will be removed in the next versions.")]
protected static readonly Func<string, byte[]> FromBase64Legacy = base64 =>
{
var bytes = Convert.FromBase64String(base64).ToList();
Expand Down

0 comments on commit 49fe87b

Please sign in to comment.