Skip to content

Commit

Permalink
fix memory corruption issue
Browse files Browse the repository at this point in the history
see https://gist.github.com/keltecc/49da037072276f21b005a8337c15db26
for details on the issue

verified by running proof of concept against fix -
> python poc.py
3.11.0 (main, Nov 24 2022, 13:13:19) [Clang 13.1.6 (clang-1316.0.21.2.5)]
X: 0x0
Y: 0x0
(On curve <MyCurve>)
<POINT AT INFINITY>
  • Loading branch information
AntonKueltz committed Feb 22, 2024
1 parent 3258e0d commit 57fc568
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -19,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux"
]
Expand Down
1 change: 1 addition & 0 deletions src/curveMath.c
Expand Up @@ -215,6 +215,7 @@ static PyObject * curvemath_mul(PyObject *self, PyObject *args) {
}

PointZZ_p result;
mpz_inits(result.x, result.y, NULL);
mpz_t scalar;
mpz_init_set_str(scalar, d, 10);
CurveZZ_p * curve = buildCurveZZ_p(p, a, b, q, gx, gy, 10);;
Expand Down

0 comments on commit 57fc568

Please sign in to comment.