elliptic curves implementation in python