chiark / gitweb /
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>
Sat, 11 Apr 2020 11:49:31 +0000 (12:49 +0100)
commit6311e4f71d2aac179fa3841d47302cdb642e487d
tree57304817088d7aa95ad37016af2a9a4b5bec2b01
parentf5427c205d2793a24c4fca1983035c4344101664
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