diff options
| author | J08nY | 2017-02-14 22:57:49 +0100 |
|---|---|---|
| committer | J08nY | 2017-02-14 22:57:49 +0100 |
| commit | 2cf95775a1d1a41d49f86cbd2d66290653201367 (patch) | |
| tree | dcaacac863a68ff69639a73c363dd498808e93e2 /src/math | |
| parent | 39c6155e0193ff69dcdf765e936487bfcf4f1b17 (diff) | |
| download | ecgen-2cf95775a1d1a41d49f86cbd2d66290653201367.tar.gz ecgen-2cf95775a1d1a41d49f86cbd2d66290653201367.tar.zst ecgen-2cf95775a1d1a41d49f86cbd2d66290653201367.zip | |
Fixed invalid curve generation and prime order point generation
- Wrong point order was saved (point.c:105)
- Curve was not copied correctly (curve.c:32)
Diffstat (limited to 'src/math')
| -rw-r--r-- | src/math/curve.c | 1 | ||||
| -rw-r--r-- | src/math/point.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/src/math/curve.c b/src/math/curve.c index 2ff3d8f..8c8b514 100644 --- a/src/math/curve.c +++ b/src/math/curve.c @@ -29,6 +29,7 @@ curve_t *curve_copy(curve_t *src, curve_t *dest) { dest->points = points_copy(src->points, dest->points, src->npoints); dest->npoints = src->npoints; } + return dest; } void curve_free(curve_t **curve) { diff --git a/src/math/point.c b/src/math/point.c index 2cf1042..0bedc11 100644 --- a/src/math/point.c +++ b/src/math/point.c @@ -102,7 +102,7 @@ int points_prime(curve_t *curve, config_t *config, ...) { point_t *p = point_new(); p->point = point; - p->order = ord; + p->order = gel(primes, i); curve->points[i - 1] = p; npoints++; } |
