using System;
using System.Runtime.InteropServices;
using Mono.Security.Cryptography;
namespace System.Security.Cryptography
{
/// Computes a Hash-based Message Authentication Code (HMAC) using the hash function.
// Token: 0x02000507 RID: 1287
[ComVisible(true)]
public class HMACSHA512 : HMAC
{
/// Initializes a new instance of the class with a randomly generated key.
// Token: 0x06002F6A RID: 12138 RVA: 0x00098C50 File Offset: 0x00096E50
public HMACSHA512()
: this(KeyBuilder.Key(8))
{
this.ProduceLegacyHmacValues = HMACSHA512.legacy_mode;
}
/// Initializes a new instance of the class with the specified key data.
/// The secret key for encryption. The key can be any length. However, if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes.
/// The parameter is null.
// Token: 0x06002F6B RID: 12139 RVA: 0x00098C6C File Offset: 0x00096E6C
public HMACSHA512(byte[] key)
{
this.ProduceLegacyHmacValues = HMACSHA512.legacy_mode;
base.HashName = "SHA512";
this.HashSizeValue = 512;
this.Key = key;
}
/// Provides a workaround for the .NET Framework version 2.0 implementation of the algorithm, which is inconsistent with the .NET Framework version 2.0 Service Pack 1 implementation.
/// true to enable .NET Framework version 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false.
// Token: 0x1700095C RID: 2396
// (get) Token: 0x06002F6D RID: 12141 RVA: 0x00098CC4 File Offset: 0x00096EC4
// (set) Token: 0x06002F6E RID: 12142 RVA: 0x00098CCC File Offset: 0x00096ECC
public bool ProduceLegacyHmacValues
{
get
{
return this.legacy;
}
set
{
this.legacy = value;
base.BlockSizeValue = ((!this.legacy) ? 128 : 64);
}
}
// Token: 0x04001358 RID: 4952
private static bool legacy_mode = Environment.GetEnvironmentVariable("legacyHMACMode") == "1";
// Token: 0x04001359 RID: 4953
private bool legacy;
}
}