/// <inheritdoc /> protected internal override bool VerifySignature(byte[] data, byte[] signature) { using (var algorithm = MacAlgorithmProvider.GetAlgorithm(this.algorithm)) { byte[] computedMac; #if Android algorithm.Init(MacAlgorithmProvider.GetSecretKey(this.algorithm, this.key)); computedMac = algorithm.DoFinal(data); #else algorithm.Key = this.key; computedMac = algorithm.ComputeHash(data); #endif return(CryptoUtilities.BufferEquals(computedMac, signature)); } }
/// <inheritdoc/> public bool Compare(byte[] object1, byte[] object2) { return(CryptoUtilities.BufferEquals(object1, object2)); }