public void TestFromBytesRejectsTooShortBuffer() { var curve = new CurveGroupAlgebra(largeParameters); var buffer = new byte[7]; Assert.Throws <ArgumentException>( () => curve.FromBytes(buffer) ); }
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); }
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); }