summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Hook <dgh@cryptoworkshop.com>2020-08-28 16:41:59 +1000
committerDavid Hook <dgh@cryptoworkshop.com>2020-08-28 16:41:59 +1000
commit6bda937a1f922195fb233aa36b81ffc4ea6dd84b (patch)
tree4c663c863a010a16c3e1beaeecbccda1573426f5
parentUpdate versions and release notes for 1.8.7 (diff)
downloadBouncyCastle.NET-ed25519-6bda937a1f922195fb233aa36b81ffc4ea6dd84b.tar.xz
added IDigestFactory
-rw-r--r--crypto/src/crypto/IDigestFactory.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/crypto/src/crypto/IDigestFactory.cs b/crypto/src/crypto/IDigestFactory.cs
new file mode 100644
index 000000000..b37bab90e
--- /dev/null
+++ b/crypto/src/crypto/IDigestFactory.cs
@@ -0,0 +1,24 @@
+namespace Org.BouncyCastle.Crypto
+{
+    /// <summary>
+    /// Base interface for operator factories that create stream-based digest calculators.
+    /// </summary>
+    /// <typeparam name="A">The algorithm details/parameter type for the digest factory.</typeparam>
+    public interface IDigestFactory<out A>
+	{
+		/// <summary>The algorithm details object for calculators made by this factory.</summary>
+		A AlgorithmDetails { get ; }
+
+		/// <summary>Return the size of the digest associated with this factory.</summary>
+		/// <returns>The length of the digest produced by this calculators from this factory in bytes.</returns>
+		int DigestLength { get; }
+
+		/// <summary>
+		/// Create a stream calculator for the digest associated with this factory. The stream
+		/// calculator is used for the actual operation of entering the data to be digested
+		/// and producing the digest block.
+		/// </summary>
+		/// <returns>A calculator producing an IBlockResult with the final digest in it.</returns>
+		IStreamCalculator<IBlockResult> CreateCalculator();
+	}
+}