chiark / gitweb /
field: Correct conversions from integers.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 30 Mar 2006 23:25:22 +0000 (00:25 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 30 Mar 2006 23:25:22 +0000 (00:25 +0100)
commitc62f9ebfe16a96a771af2343c2358d49668e31b0
tree90e779aa742deffcad27078cf6f10aca0c5a8e99
parent2308db6f3426903c7af459627c7195912c1bce6a
field: Correct conversions from integers.

The function tofe refused to convert integers to field elements.  I seem
to remember deciding that this was too weird for binary fields, but in
retrospect this seems a mistake, since there's nothing stopping a binary
field element converting to an mp (or gf).

Previously, binary operations between a field element and a Python
integer failed, but a binop with a fe and an mp would force the fe to
downgrade to an mp, which seems really bizarre.

Also, I think there was a possibility of a memory leak in the old code.
field.c