public void Decrypt_throws_on_mismatching_tag()
        {
            var blob = TestBlob.Decode64();

            blob[blob.Length - 1] += 1;

            Exceptions.AssertThrowsInternalError(() => Opdata01.Decrypt(blob, TestKey), "tag doesn't match");
        }
        public void Decrypt_throws_on_invalid_signature()
        {
            var blob = TestBlob.Decode64();

            blob[0] += 1;

            Exceptions.AssertThrowsInternalError(() => Opdata01.Decrypt(blob, TestKey), "invalid signature");
        }
 public void Decrypt_bytes_returns_plaintext()
 {
     Assert.Equal(256, Opdata01.Decrypt(TestBlob.Decode64(), TestKey).Length);
 }
 public void Decrypt_throws_short_input()
 {
     Exceptions.AssertThrowsInternalError(() => Opdata01.Decrypt(new byte[63], TestKey), "too short");
 }
 public void Decrypt_base64_returns_plaintext()
 {
     Assert.Equal(256, Opdata01.Decrypt(TestBlob, TestKey).Length);
 }