summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2020-09-21 23:03:59 +0700
committerPeter Dettman <peter.dettman@bouncycastle.org>2020-09-21 23:03:59 +0700
commit3e6afabe096e1557c75da39953f72e2eda62ee82 (patch)
tree4a6ff5f0a7c2d599aa3010987f0fb552f41c66f1 /crypto/src
parentECC: Binary field perf. opt. (diff)
downloadBouncyCastle.NET-ed25519-3e6afabe096e1557c75da39953f72e2eda62ee82.tar.xz
Fix .NET 1.1 build
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/IDigestFactory.cs2
-rw-r--r--crypto/src/crypto/operators/Asn1DigestFactory.cs53
2 files changed, 30 insertions, 25 deletions
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); } - } - - - }