Skip to content

Commit 1efc58d

Browse files
authored
Remove use of NO_NATIVESHA1 (#1370)
1 parent b99802d commit 1efc58d

3 files changed

Lines changed: 2 additions & 296 deletions

File tree

‎NBitcoin/BouncyCastle/crypto/digests/Sha1Digest.cs‎

Lines changed: 0 additions & 288 deletions
This file was deleted.

‎NBitcoin/Crypto/Hashes.cs‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,8 @@ public static byte[] RIPEMD160(byte[] data, int offset, int count)
100100
}
101101
public static byte[] SHA1(byte[] data, int offset, int count)
102102
{
103-
#if NO_NATIVESHA1
104-
var sha1 = new Sha1Digest();
105-
sha1.BlockUpdate(data, offset, count);
106-
byte[] rv = new byte[20];
107-
sha1.DoFinal(rv, 0);
108-
return rv;
109-
#elif NET10_0_OR_GREATER
103+
104+
#if NET10_0_OR_GREATER
110105
return System.Security.Cryptography.SHA1.HashData(data.AsSpan(offset, count));
111106
#else
112107
using (var sha1 = System.Security.Cryptography.SHA1.Create())

‎NBitcoin/NBitcoin.csproj‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
<Compile Include="BouncyCastle\util\Arrays.cs"></Compile>
6868
<Compile Include="BouncyCastle\util\Platform.cs"></Compile>
6969
<Compile Include="BouncyCastle\crypto\digests\RipeMD160Digest.cs"></Compile>
70-
<Compile Include="BouncyCastle\crypto\digests\Sha1Digest.cs"></Compile>
7170
<Compile Include="BouncyCastle\crypto\digests\Sha256Digest.cs"></Compile>
7271
<Compile Include="BouncyCastle\crypto\digests\KeccakDigest.cs"></Compile>
7372
<Compile Include="BouncyCastle\crypto\digests\Sha3Digest.cs"></Compile>

0 commit comments

Comments
 (0)