ec.c, field.c, group.c, mp.c: Fix conversions in `pow' and scalar mul.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 24 Nov 2019 00:18:43 +0000 (00:18 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 25 Nov 2019 17:51:32 +0000 (17:51 +0000)
commitf3e229044acf6dacc2e3428ac15e4b69772e3e8a
tree727ec6a2106374b9fdd4699a0c01bcae35f66ae4
parent4dc1425be94a278259442aee3a966e1dc49c09ee
ec.c, field.c, group.c, mp.c: Fix conversions in `pow' and scalar mul.

The base and modulus (if present) should belong to the base ring; the
exponent or scalar should be an integer; and we should use implicit-
conversion rules for all three.  (Of course, the modulus can also be
`None'.)

This tightening temporarily breaks a test multiplying an elliptic curve
point by a prime-field element Q n.  That used to work, but not for any
especially principled reason; and this wasn't commutative (n Q would
multiply n by the x-coordinate of Q coerced into the scalar field).  We
shall fix this soon.
ec.c
field.c
group.c
mp.c
t/t-convert.py
t/t-ec.py