You'll want to make those globals constant. This also looks to be pretty type unstable. Using dispatch to express some of the logic may seem appealing but I suspect it's not a good idea unless the result type only depends on the input types.
> On Oct 21, 2014, at 6:42 PM, alexander maznev <[email protected]> > wrote: > > This should be an equivalent, or nearly there, implementation of Elliptic > Curves mod p as found in the Python ecdsa library. > > https://gist.github.com/anonymous/a3799a5a2b0354022eac > > Noticeably, regular mod is 10x slower than python? > Inverse_mod is 7x slower than python. > Double is 7x slower than python > Multiply is more than 7X slower than python. >
