summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--ecc-point.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index d3ca0def..ad89c2ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);
}