Skip to content

Instantly share code, notes, and snippets.

@SzShow
Last active December 15, 2019 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SzShow/0ea559ee06d5f55abdf12e2f69b1f9ee to your computer and use it in GitHub Desktop.
Save SzShow/0ea559ee06d5f55abdf12e2f69b1f9ee to your computer and use it in GitHub Desktop.
classdef ElipticCurve < handle
properties (Access = public)
a
b
p
end
methods (Access = public)
function obj = ElipticCurve(a, b, p)
obj.a = mod(sym(a), sym(p));
obj.b = mod(sym(b), sym(p));
obj.p = sym(p);
end
function y = CalculateY2(obj, x)
y = mod((sym(x)^3)+(obj.a*x)+obj.b, obj.p);
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment