Bu konudaki matematiği benden daha iyi biliyor olabilirsin. Sen de bana bu konuda daha detaylı bilgi verebilir misin?
Örneğin senin aradığın temel kodu ifade eden şöyle bir kod yazalım. Ancak burada x ve y kaç bitlik integer sayılar olmalı ve ECdouble için ne kadar duyarlı bir kayan noktalı sayı gerekiyor?
Bu temel kod üzerinden bana adım adım ElipticCurve'nin işlevini anlatabilir misin? EC_double işlevi de Point mi döndürüyor?
class Point
{
public:
long long int x, y;
public: Point(long long int _x, long long int _y)
{
x = _x;
y = _y;
}
public: void print()
{
cout << "(";
cout << x;
cout << ", ";
cout << y;
cout ")";
}
};
class EllipticCurve
{
public:
int a;
int b;
unsigned int m;
public: EllipticCurve(int _a, int_b, unsigned int modul)
{
a = _a;
b = _b;
m = modul;
}
public: Point generate(unsigned long long int x)
{
// looks for Points on the curve with the given x coordinate
// returns the first matching point
}
public: Point add(Point p, Point q)
{
// complex addition function with if-else trees
// the function code is not needed for this question
}
public: Point mul(Point p, unsigned int n)
{
// see above
}
};