using System.Runtime.InteropServices;
using ProtonVPN.OperatingSystems.WebAuthn.Interop.Marshalers;
namespace ProtonVPN.OperatingSystems.WebAuthn.Interop.Structs;
///
/// Contains the SALT values for the Hmac-Secret.
///
/// Corresponds to WEBAUTHN_HMAC_SECRET_SALT.
[StructLayout(LayoutKind.Sequential)]
public class HmacSecretSaltIn : IDisposable
{
///
/// Size of _first.
///
private int _firstLength;
///
/// The first SALT value.
///
private ByteArrayIn _first;
///
/// Size of _second.
///
private int _secondLength;
///
/// The second SALT value.
///
private ByteArrayIn _second;
public HmacSecretSaltIn(byte[] first, byte[] second)
{
// TODO: Check if the length of the values is WEBAUTHN_CTAP_ONE_HMAC_SECRET_LENGTH.
_first = new ByteArrayIn(first);
_firstLength = first?.Length ?? 0;
_second = new ByteArrayIn(second);
_secondLength = second?.Length ?? 0;
}
public void Dispose()
{
_first?.Dispose();
_first = null;
_second?.Dispose();
_second = null;
}
}