From: Niels Möller Date: Thu, 4 Apr 2013 14:28:40 +0000 (+0200) Subject: ecc_point_get: Allow NULL x or y. X-Git-Tag: nettle_2.7_release_20130424~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2dfae9f33daefc7c1fcb39cf50420a087cd45d5c;p=thirdparty%2Fnettle.git ecc_point_get: Allow NULL x or y. --- diff --git a/ChangeLog b/ChangeLog index d3ca0def..ad89c2ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2013-04-04 Niels Möller + * 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); }