diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-09-21 23:03:59 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-09-21 23:03:59 +0700 |
commit | 3e6afabe096e1557c75da39953f72e2eda62ee82 (patch) | |
tree | 4a6ff5f0a7c2d599aa3010987f0fb552f41c66f1 | |
parent | ECC: Binary field perf. opt. (diff) | |
download | BouncyCastle.NET-ed25519-3e6afabe096e1557c75da39953f72e2eda62ee82.tar.xz |
Fix .NET 1.1 build
-rw-r--r-- | crypto/crypto.csproj | 10 | ||||
-rw-r--r-- | crypto/src/crypto/IDigestFactory.cs | 2 | ||||
-rw-r--r-- | crypto/src/crypto/operators/Asn1DigestFactory.cs | 53 |
3 files changed, 40 insertions, 25 deletions
diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj index 29e9cb718..a940fbd0b 100644 --- a/crypto/crypto.csproj +++ b/crypto/crypto.csproj @@ -3269,6 +3269,11 @@ BuildAction = "Compile" /> <File + RelPath = "src\crypto\IDigestFactory.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "src\crypto\IDSA.cs" SubType = "Code" BuildAction = "Compile" @@ -4424,6 +4429,11 @@ BuildAction = "Compile" /> <File + RelPath = "src\crypto\operators\Asn1DigestFactory.cs" + SubType = "Code" + BuildAction = "Compile" + /> + <File RelPath = "src\crypto\operators\Asn1KeyWrapper.cs" SubType = "Code" BuildAction = "Compile" diff --git a/crypto/src/crypto/IDigestFactory.cs b/crypto/src/crypto/IDigestFactory.cs index b46769cd3..eedac14e4 100644 --- a/crypto/src/crypto/IDigestFactory.cs +++ b/crypto/src/crypto/IDigestFactory.cs @@ -1,3 +1,5 @@ +using System; + namespace Org.BouncyCastle.Crypto { /// <summary> diff --git a/crypto/src/crypto/operators/Asn1DigestFactory.cs b/crypto/src/crypto/operators/Asn1DigestFactory.cs index 2455db3a0..91fb46c51 100644 --- a/crypto/src/crypto/operators/Asn1DigestFactory.cs +++ b/crypto/src/crypto/operators/Asn1DigestFactory.cs @@ -1,16 +1,15 @@ -using Org.BouncyCastle.Asn1; +using System; +using System.IO; + +using Org.BouncyCastle.Asn1; using Org.BouncyCastle.Asn1.X509; using Org.BouncyCastle.Crypto.IO; using Org.BouncyCastle.Security; -using System; -using System.IO; - namespace Org.BouncyCastle.Crypto.Operators { public class Asn1DigestFactory : IDigestFactory { - public static Asn1DigestFactory Get(DerObjectIdentifier oid) { return new Asn1DigestFactory(DigestUtilities.GetDigest(oid), oid); @@ -22,46 +21,50 @@ namespace Org.BouncyCastle.Crypto.Operators return new Asn1DigestFactory(DigestUtilities.GetDigest(oid), oid); } - - private IDigest digest; - private DerObjectIdentifier oid; + private readonly IDigest mDigest; + private readonly DerObjectIdentifier mOid; public Asn1DigestFactory(IDigest digest, DerObjectIdentifier oid) { - this.digest = digest; - this.oid = oid; + this.mDigest = digest; + this.mOid = oid; } - public object AlgorithmDetails => new AlgorithmIdentifier(oid); + public virtual object AlgorithmDetails + { + get { return new AlgorithmIdentifier(mOid); } + } - public int DigestLength => digest.GetDigestSize(); + public virtual int DigestLength + { + get { return mDigest.GetDigestSize(); } + } - public IStreamCalculator CreateCalculator() => new DfDigestStream(digest); - + public virtual IStreamCalculator CreateCalculator() + { + return new DfDigestStream(mDigest); + } } - internal class DfDigestStream : IStreamCalculator { - - private DigestSink stream; + private readonly DigestSink mStream; public DfDigestStream(IDigest digest) { - stream = new DigestSink(digest); + this.mStream = new DigestSink(digest); } - public Stream Stream => stream; + public Stream Stream + { + get { return mStream; } + } public object GetResult() { - byte[] result = new byte[stream.Digest.GetDigestSize()]; - stream.Digest.DoFinal(result, 0); + byte[] result = new byte[mStream.Digest.GetDigestSize()]; + mStream.Digest.DoFinal(result, 0); return new SimpleBlockResult(result); } - } - - - } |