mdanter/phpecc — pull request #31 by afk11 (2014-12-29 13:11:56+00:00)
Title: Ecmath

Added an EcMath class, which accepts a numeric value or a PointInterface.
Added an interface, covering add(), mul(), getDouble(), mod(), and cmp(), and result().

There are tests for the EcMath class, mainly just asserting some operations like (k+k)*G = (k*G)+(k*G).
Test.php has some examples of usage. (Private/Public classes are not the classes used in this library)

The library tolerates you trying to add an integer to a point, by carrying out the point multiplication when required.
It will throw an exception if you try to do something impossible, like multiplying two points together.

I haven't added an equals() function, like the Point and Math class both have, though I will probably add this shortly. Also want to refactor the Math, EcMath, and Crypto components into namespaces, after we discuss it.