Beispiel #1
0
        void dot16_check()
        {
            for (var i = 0; i < SampleSize; i++)
            {
                var x = Random.BitVector16();
                var y = Random.BitVector16();
                var a = x % y;
                var b = ModProd(x, y);
                Claim.yea(a == b);

                var zx = x.ToGeneric();
                var zy = y.ToGeneric();
                var c  = zx % zy;
                Claim.yea(a == c);
            }
        }
Beispiel #2
0
        public void bmv_16x16()
        {
            for (var sample = 0; sample < SampleSize; sample++)
            {
                var m  = Random.BitMatrix16();
                var c  = Random.BitVector16();
                var z1 = m * c;
                var z2 = BitVector16.Alloc();
                for (var i = 0; i < m.RowCount; i++)
                {
                    var r = m.RowVector(i);
                    z2[i] = r % c;
                }

                Claim.yea(z1 == z2);
            }
        }
Beispiel #3
0
        public void gfmul512()
        {
            for (var i = 0; i < CycleCount; i++)
            {
                var x1 = Random.BitVector16(2 * 32);
                var x2 = Random.BitVector16(2 * 32);
                var p1 = Gf512.mul(x1, x2);
                var p2 = Gf512.mul_ref(x1, x2);
                Claim.eq(p1, p2);

                if (x1.Nonempty)
                {
                    var order = x1.Order();
                    Claim.eq(BitVector16.One, x1.Pow(order));
                }
            }
        }