diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..9cd8097 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node-terminal", + "name": "JavaScript Debug Terminal", + "request": "launch", + "cwd": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/Src/FinderOuter/Backend/ECC/Calc2.cs b/Src/FinderOuter/Backend/ECC/Calc2.cs index 99f93af..cde679d 100644 --- a/Src/FinderOuter/Backend/ECC/Calc2.cs +++ b/Src/FinderOuter/Backend/ECC/Calc2.cs @@ -154,7 +154,9 @@ public bool Test() string actual = final.ToArray().ToBase16(); +#pragma warning disable CS0612 using PrivateKey key = new(data.ToArray()); +#pragma warning restore CS0612 string expected = key.ToPublicKey().ToByteArray(false).ToBase16(); Debug.Assert(actual == expected); diff --git a/Src/FinderOuter/Backend/Hashing/Hash160Fo.cs b/Src/FinderOuter/Backend/Hashing/Hash160Fo.cs index b172645..5bcabd5 100644 --- a/Src/FinderOuter/Backend/Hashing/Hash160Fo.cs +++ b/Src/FinderOuter/Backend/Hashing/Hash160Fo.cs @@ -186,7 +186,7 @@ public static unsafe byte[] Compress33(Span data) public static unsafe byte[] Compress65(Span data) { - Debug.Assert(data != null && data.Length == 65); + Debug.Assert(data.Length == 65); uint* pt = stackalloc uint[Sha256Fo.UBufferSize]; fixed (byte* dPt = &data[0]) diff --git a/Src/FinderOuter/Backend/Hashing/Sha256Fo.cs b/Src/FinderOuter/Backend/Hashing/Sha256Fo.cs index 9d3ed2d..d7ad998 100644 --- a/Src/FinderOuter/Backend/Hashing/Sha256Fo.cs +++ b/Src/FinderOuter/Backend/Hashing/Sha256Fo.cs @@ -2321,7 +2321,7 @@ public static unsafe void CompressDouble40(uint* pt) /// 65 byte data public static unsafe byte[] CompressDouble65(Span data) { - Debug.Assert(data != null && data.Length == 65); + Debug.Assert(data.Length == 65); uint* pt = stackalloc uint[UBufferSize]; fixed (byte* dPt = &data[0]) diff --git a/Src/FinderOuter/FinderOuter.csproj b/Src/FinderOuter/FinderOuter.csproj index a3f662f..2956337 100644 --- a/Src/FinderOuter/FinderOuter.csproj +++ b/Src/FinderOuter/FinderOuter.csproj @@ -1,7 +1,7 @@  WinExe - net8.0 + net10.0 0.20.0.0 0.20.0.0 0.20.0.0 diff --git a/Src/FinderOuter/Services/ArmoryService.cs b/Src/FinderOuter/Services/ArmoryService.cs index 39ae421..39a33cb 100644 --- a/Src/FinderOuter/Services/ArmoryService.cs +++ b/Src/FinderOuter/Services/ArmoryService.cs @@ -36,7 +36,9 @@ public ArmoryService(IReport rep) private int[] missingIndexes; private bool hasChainCode; private byte[] chainCode; +#pragma warning disable CS0612 private readonly BigInteger N = new SecP256k1().N; +#pragma warning restore CS0612 diff --git a/Src/FinderOuter/Services/Base58Service.cs b/Src/FinderOuter/Services/Base58Service.cs index cfb7ad7..b62c25d 100644 --- a/Src/FinderOuter/Services/Base58Service.cs +++ b/Src/FinderOuter/Services/Base58Service.cs @@ -60,7 +60,9 @@ private bool IsMissingFromEnd() private BigInteger wifEndStart; private void SetResultParallelWifEnd(int added) { +#pragma warning disable CS0612 using PrivateKey tempKey = new(wifEndStart + added); +#pragma warning restore CS0612 string tempWif = tempKey.ToWif(isWifEndCompressed); report.AddMessageSafe($"Found the key: {tempWif}"); report.FoundAnyResult = true; @@ -141,7 +143,9 @@ private void WifLoopMissingEnd(bool compressed) BigInteger diff = end - start + 1; report.AddMessageSafe($"Using an optimized method checking only {diff:n0} keys."); +#pragma warning disable CS0612 Autarkysoft.Bitcoin.Cryptography.Asymmetric.EllipticCurve.SecP256k1 curve = new(); +#pragma warning restore CS0612 if (start == 0 || end >= curve.N) { report.AddMessageSafe("There is something wrong with the given key, it is outside of valid key range."); @@ -154,7 +158,9 @@ private void WifLoopMissingEnd(bool compressed) { for (int i = 0; i < (int)diff; i++) { +#pragma warning disable CS0612 using PrivateKey tempKey = new(start + i); +#pragma warning restore CS0612 string tempWif = tempKey.ToWif(compressed); if (tempWif.Contains(baseWif)) { diff --git a/Src/FinderOuter/Services/Comparers/PrvToPrvComparer.cs b/Src/FinderOuter/Services/Comparers/PrvToPrvComparer.cs index d17cf8f..58b1e37 100644 --- a/Src/FinderOuter/Services/Comparers/PrvToPrvComparer.cs +++ b/Src/FinderOuter/Services/Comparers/PrvToPrvComparer.cs @@ -25,7 +25,9 @@ public bool Init(string data) { try { +#pragma warning disable CS0612 using PrivateKey temp = new(data); +#pragma warning restore CS0612 expectedBytes = temp.ToBytes(); expectedKey = new(expectedBytes, out _); IsInitialized = true; diff --git a/Src/Tests/Tests.csproj b/Src/Tests/Tests.csproj index 96ab31e..99d8dff 100644 --- a/Src/Tests/Tests.csproj +++ b/Src/Tests/Tests.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 false