示例#1
0
        public void TestFromBytesRejectsTooShortBuffer()
        {
            var curve  = new CurveGroupAlgebra(largeParameters);
            var buffer = new byte[7];

            Assert.Throws <ArgumentException>(
                () => curve.FromBytes(buffer)
                );
        }
示例#2
0
        public void TestFromBytesWithLessThanOneByteLargeElements()
        {
            var curve    = new CurveGroupAlgebra(curveParameters);
            var expected = new CurvePoint(5, 3);
            var buffer   = new byte[] { 5, 3 };

            var result = curve.FromBytes(buffer);

            Assert.AreEqual(expected, result);
        }
示例#3
0
        public void TestFromBytes()
        {
            var curve    = new CurveGroupAlgebra(largeParameters);
            var expected = new CurvePoint(5, 3);
            var buffer   = new byte[] { 5, 0, 0, 0, 3, 0, 0, 0 };

            var result = curve.FromBytes(buffer);

            Assert.AreEqual(expected, result);
        }