/* @author: Christopher Evans A C++ class that implements an elliptic curve class. Current implementation is minimal, but can be extended to greater functionality. This implementation is valid only for elliptic curves defined over a field K where char(K) != 2, 3 in an attempt to greatly simplify the data requirements and computational complexity. The data is named to fit the following Weierstrass equation defining an elliptic curve over a finite field K where char(K) != 2,3: y^2= x^3 + a x^2 + b mod p This class is serializable, and a standard function for the given implementation is included which outputs the given information into a string, with values comma-seperated. A constructor which takes a string (presumably of the correct format) and constructs the proper elliptic curve is also included. Robustness of the initial implementation is minimal, focusing primarily on efficiency and functionality. */ #ifndef _ELLIPTIC_CURVES_H #define _ELLIPTIC_CURVES_H #include #include #include using namespace std; class Elliptic_Curve{ private: long a; long b; long p; long b1; long b2; int string_to_int(string object); string int_to_string(int object); public: Elliptic_Curve(); //default constructor, initializes all variables to 0; which won't do you much good Elliptic_Curve(long _a, long _b, long _p, long _b1, long _b2); // constructor, initializes all variables to the given input Elliptic_Curve(string input_data); //constructor, initializes all variables from a serialized string, presumably given in the correct format string to_serial(); // serializes an instance of Elliptic_Curve into a string in CSV format. }; #endif