diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ecc-point.c | 6 |
2 files changed, 7 insertions, 2 deletions
@@ -1,5 +1,8 @@ 2013-04-04 Niels Möller <nisse@lysator.liu.se> + * ecc-point.c (ecc_point_get): Allow NULL x or y, ignore + corresponding coordinate. + * nettle.texinfo (Elliptic curves): Document high-level ECDSA support. diff --git a/ecc-point.c b/ecc-point.c index 4d3489c4..82645a79 100644 --- a/ecc-point.c +++ b/ecc-point.c @@ -84,6 +84,8 @@ void ecc_point_get (const struct ecc_point *p, mpz_t x, mpz_t y) { mp_size_t size = p->ecc->size; - mpz_set_n (x, p->p, size); - mpz_set_n (y, p->p + size, size); + if (x) + mpz_set_n (x, p->p, size); + if (y) + mpz_set_n (y, p->p + size, size); } |