Exemplo n.º 1
0
        public bool Verify(byte[] mac, int macOffset, byte[] message, int messageOffset, int messageLength, byte[] key)
        {
            m_hmac.Key = key;

            byte[] mac2 = m_hmac.ComputeHash(message, messageOffset, messageLength);

            return(SafeComparison.Verify32(mac, macOffset, mac2, 0));
        }
Exemplo n.º 2
0
        public bool Verify(byte[] hash, int hashOffset, byte[] input, int inputOffset, int inputLength, byte[] key, int keyOffset)
        {
            m_poly1305.SetKey(key, keyOffset);

            byte[] correct = new byte[16];

            m_poly1305.Transform(input, inputOffset, inputLength);
            m_poly1305.Finish(correct);

            return(SafeComparison.Verify16(hash, hashOffset, correct, 0));
        }