mirrored from https://www.bouncycastle.org/repositories/bc-csharp
-
Notifications
You must be signed in to change notification settings - Fork 564
/
Copy pathIDigest.cs
53 lines (44 loc) · 2.42 KB
/
IDigest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using System;
namespace Org.BouncyCastle.Crypto
{
/// <remarks>Base interface for a message digest.</remarks>
public interface IDigest
{
/// <summary>The algorithm name.</summary>
string AlgorithmName { get; }
/// <summary>Return the size, in bytes, of the digest produced by this message digest.</summary>
/// <returns>The size, in bytes, of the digest produced by this message digest.</returns>
int GetDigestSize();
/// <summary>Return the size, in bytes, of the internal buffer used by this digest.</summary>
/// <returns>The size, in bytes, of the internal buffer used by this digest.</returns>
int GetByteLength();
/// <summary>Update the message digest with a single byte.</summary>
/// <param name="input">The input byte to be entered.</param>
void Update(byte input);
/// <summary>Update the message digest with a block of bytes.</summary>
/// <param name="input">The byte array containing the data.</param>
/// <param name="inOff">The offset into the byte array where the data starts.</param>
/// <param name="inLen">The length of the data.</param>
void BlockUpdate(byte[] input, int inOff, int inLen);
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
/// <summary>Update the message digest with a span of bytes.</summary>
/// <param name="input">The span containing the data.</param>
void BlockUpdate(ReadOnlySpan<byte> input);
#endif
/// <summary>Close the digest, producing the final digest value.</summary>
/// <remarks>This call leaves the digest reset.</remarks>
/// <param name="output">The byte array the digest is to be copied into.</param>
/// <param name="outOff">The offset into the byte array the digest is to start at.</param>
/// <returns>The number of bytes written.</returns>
int DoFinal(byte[] output, int outOff);
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
/// <summary>Close the digest, producing the final digest value.</summary>
/// <remarks>This call leaves the digest reset.</remarks>
/// <param name="output">The span the digest is to be copied into.</param>
/// <returns>The number of bytes written.</returns>
int DoFinal(Span<byte> output);
#endif
/// <summary>Reset the digest back to its initial state.</summary>
void Reset();
}
}