Skip to content

Commit 4f2f534

Browse files
committed
Use DigestSink
1 parent 0123856 commit 4f2f534

File tree

1 file changed

+2
-22
lines changed

1 file changed

+2
-22
lines changed
Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33

4+
using Org.BouncyCastle.Crypto.IO;
45
using Org.BouncyCastle.Utilities.IO;
56

67
namespace Org.BouncyCastle.Crypto.Tls
@@ -10,28 +11,7 @@ internal class DigestInputBuffer
1011
{
1112
internal void UpdateDigest(IDigest d)
1213
{
13-
Streams.WriteBufTo(this, new DigStream(d));
14-
}
15-
16-
private class DigStream
17-
: BaseOutputStream
18-
{
19-
private readonly IDigest d;
20-
21-
internal DigStream(IDigest d)
22-
{
23-
this.d = d;
24-
}
25-
26-
public override void WriteByte(byte b)
27-
{
28-
d.Update(b);
29-
}
30-
31-
public override void Write(byte[] buf, int off, int len)
32-
{
33-
d.BlockUpdate(buf, off, len);
34-
}
14+
Streams.WriteBufTo(this, new DigestSink(d));
3515
}
3616
}
3717
}

0 commit comments

Comments
 (0)