chiark / gitweb /
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.