summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/crypto/tls/DigestInputBuffer.cs24
1 files changed, 2 insertions, 22 deletions
diff --git a/crypto/src/crypto/tls/DigestInputBuffer.cs b/crypto/src/crypto/tls/DigestInputBuffer.cs
index 4435b40a5..acc6756e4 100644
--- a/crypto/src/crypto/tls/DigestInputBuffer.cs
+++ b/crypto/src/crypto/tls/DigestInputBuffer.cs
@@ -1,6 +1,7 @@
 using System;
 using System.IO;
 
+using Org.BouncyCastle.Crypto.IO;
 using Org.BouncyCastle.Utilities.IO;
 
 namespace Org.BouncyCastle.Crypto.Tls
@@ -10,28 +11,7 @@ namespace Org.BouncyCastle.Crypto.Tls
     {
         internal void UpdateDigest(IDigest d)
         {
-            Streams.WriteBufTo(this, new DigStream(d));
-        }
-
-        private class DigStream
-            :   BaseOutputStream
-        {
-            private readonly IDigest d;
-
-            internal DigStream(IDigest d)
-            {
-                this.d = d;
-            }
-
-            public override void WriteByte(byte b)
-            {
-                d.Update(b);
-            }
-
-            public override void Write(byte[] buf, int off, int len)
-            {
-                d.BlockUpdate(buf, off, len);
-            }
+            Streams.WriteBufTo(this, new DigestSink(d));
         }
     }
 }