#4964: [with patch, with review, needs work] Add Weil pairing to Sage
-------------------------------------+--------------------------------------
Reporter: dmhansen | Owner: mollerhansen
Type: enhancement | Status: reopened
Priority: minor | Milestone: sage-3.3
Component: algebraic geometry | Resolution:
Keywords: pairing, elliptic curve |
-------------------------------------+--------------------------------------
Comment (by dmhansen):
> I cannot see the problem myself. The _line_() code looks fine.
_miller_() looks good, and when the points are independent I don't see how
you would ever get 0 from one of the _line() calls. [One piece of
debugging would be to make sure that _line_() never returns zero,
perhaps).
There was definetly a zero division when computing the slope in case
P=Q\neqO in the _line_ function. Problem was that after refactoring my own
code and putting it nicely into sage I forgot the subcase P=Q\neqO x1=x2.
So the zero came from the vertical slope not being handled seperatly.
I then tried your test and I wondered why
{{{
sage: P.weil_pairing(Q,360).multiplicative_order()
181
sage: P.order()
360
sage: 180*P
(0 : 0 : 1)
}}}
I will make a bug report on it.
> Two more comments: in _miller_(), you should perhaps initialize t to
self.base_ring()(1) and not just 1. Secondly, this code would apply just
as well to points of finite order over any field, so you should move the
whole block of code so that the functions are members of
EllipticCurvePoint_field and not of the sub-class
EllipticCurvePoint_finite_field.
I think I will do this in the next iteration together with your suggestion
on saving time by precomputing the d=gcd(m1,m2) and doing the pairing of
(m1/d)*P and (m2/d)*Q. I'm a bit pressured on time this month and I think
that the next iteration will require some more extensive tests.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4964#comment:11>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---