Exemplo n.º 1
0
        public void SignAndVerify(byte[] data, byte[] keybytes)
        {
            var key = new Key(keybytes);

            Poly1305.Sign(data, 0, data.Length, in key, out Mac mac);
            Assert.True(Poly1305.Verify(data, 0, data.Length, key, in mac));
        }
Exemplo n.º 2
0
        public void VerifyFails()
        {
            var key = new Key(1, 0, 0, 0, 0, 0, 0, 0);

            Assert.False(Poly1305.Verify(new byte[] { 1 }, 0, 1, in key, default));
        }