Esempio n. 1
0
        public void Batch_Verification_Passes_For_Valid_Batch()
        {
            var sigs     = new List <ISignature>();
            var context  = Encoding.UTF8.GetBytes("context");
            var messages = new List <byte[]>
            {
                Encoding.UTF8.GetBytes("rat"),
                Encoding.UTF8.GetBytes("hat"),
                Encoding.UTF8.GetBytes("hut"),
                Encoding.UTF8.GetBytes("but"),
                Encoding.UTF8.GetBytes("bun"),
                Encoding.UTF8.GetBytes("run"),
                Encoding.UTF8.GetBytes("ran"),
                Encoding.UTF8.GetBytes("can"),
                Encoding.UTF8.GetBytes("cat"),
                Encoding.UTF8.GetBytes("rat")
            };

            messages.ForEach(x =>
            {
                sigs.Add(_wrapper.Sign(_wrapper.GeneratePrivateKey(), x, context));
            });

            var isVerified = _wrapper.BatchVerify(sigs, messages, context);

            isVerified.Should().BeTrue();
        }