(self, scalar, a)
:param scalar: int
        :param a: TwistedEdwardsCurveElement
        :return:
def mul(self, scalar, a):
        """

        :param scalar: int
        :param a: TwistedEdwardsCurveElement
        :return:
        """
        if type(scalar) != int or type(a) != TwistedEdwardsCurveElement:
            raise TypeError("Multiplication only supports a scalar with an object")
        if scalar == 0:
            return self.get_identity()
        elif scalar < 0:
            raise TypeError("Multiplication only supports non-negative scalars")
        else:
            binary_representation = int_to_binary_representation(scalar)
            res = self.identity
            for exponent in binary_representation:
                res = self.add(res, self._multiple_twice(exponent, a))
            return res
def mul ( self , scalar , a ) : if type ( scalar ) != int or type ( a ) != TwistedEdwardsCurveElement : raise TypeError ( "Multiplication only supports a scalar with an object" ) if scalar == 0 : return self . get_identity ( ) elif scalar < 0 : raise TypeError ( "Multiplication only supports non-negative scalars" ) else : binary_representation = int_to_binary_representation ( scalar ) res = self . identity for exponent in binary_representation : res = self . add ( res , self . _multiple_twice ( exponent , a ) ) return res