blob: 9a45d6792b8ff1ac41ceab71411ee2d05be8dfe3 (
plain) (
blame)
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
|
using System;
using Org.BouncyCastle.Security;
namespace Org.BouncyCastle.Crypto.Operators
{
public sealed class DefaultMacResult
: IBlockResult
{
private readonly IMac m_mac;
public DefaultMacResult(IMac mac)
{
m_mac = mac;
}
public byte[] Collect() => MacUtilities.DoFinal(m_mac);
public int Collect(byte[] buf, int off) => m_mac.DoFinal(buf, off);
#if NETCOREAPP2_1_OR_GREATER || NETSTANDARD2_1_OR_GREATER
public int Collect(Span<byte> output) => m_mac.DoFinal(output);
#endif
public int GetMaxResultLength() => m_mac.GetMacSize();
}
}
|