ASKSAGE: Sage Q&A Forum - Individual question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 31 Mar 2016 09:43:09 -0500Elliptic curve scalar multiplication algorithmhttps://ask.sagemath.org/question/32886/elliptic-curve-scalar-multiplication-algorithm/ I'm doing a prespective on supersinguar elliptic curves. I was wondering how saga calculates scalar multiplications? Does it just calculate it naively or does it use succesive doubling as default? Til is most interesting since there are well known ways of making "shortcuts" when oberating with supersingular curves, but does sage use these?Fri, 25 Mar 2016 08:41:10 -0500https://ask.sagemath.org/question/32886/elliptic-curve-scalar-multiplication-algorithm/Answer by vdelecroix for <p>I'm doing a prespective on supersinguar elliptic curves. I was wondering how saga calculates scalar multiplications? Does it just calculate it naively or does it use succesive doubling as default? Til is most interesting since there are well known ways of making "shortcuts" when oberating with supersingular curves, but does sage use these?</p>
https://ask.sagemath.org/question/32886/elliptic-curve-scalar-multiplication-algorithm/?answer=32927#post-id-32927Hello,
Since Sage is open source, you can have a look directly at the source code by yourself. For example doing the following
sage: E = EllipticCurve(QQ,[1,1])
sage: P = E(0,1)
sage: P.__mul__??
Type: method-wrapper
String form: <method-wrapper '__mul__' of EllipticCurvePoint_number_field object at 0x7fc3fd625c30>
File: /opt/sage/src/sage/structure/element.pyx
Source:
def __mul__(left, right):
if type(right) is int:
return (<ModuleElement>left)._mul_long(PyInt_AS_LONG(right))
if type(left) is int:
return (<ModuleElement>right)._mul_long(PyInt_AS_LONG(left))
if have_same_parent_c(left, right):
raise TypeError(arith_error_message(left, right, mul))
return coercion_model.bin_op(left, right, mul)
Though the above code is not very informative. But it tells you that multiplication by scalar is inherited from the generic one in ModuleElement. And this latter code uses successive doubling but you need to look .
Concerning your second question, there does not seem to be any specific code concerning supersingular curve. Any contribution is welcome!Thu, 31 Mar 2016 09:43:09 -0500https://ask.sagemath.org/question/32886/elliptic-curve-scalar-multiplication-algorithm/?answer=32927#post-id-32927