Skip to content
Snippets Groups Projects
Commit 2dfae9f3 authored by Niels Möller's avatar Niels Möller
Browse files

ecc_point_get: Allow NULL x or y.

parent c8c37f89
No related branches found
No related tags found
No related merge requests found
2013-04-04 Niels Möller <nisse@lysator.liu.se> 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 * nettle.texinfo (Elliptic curves): Document high-level ECDSA
support. support.
......
...@@ -84,6 +84,8 @@ void ...@@ -84,6 +84,8 @@ void
ecc_point_get (const struct ecc_point *p, mpz_t x, mpz_t y) ecc_point_get (const struct ecc_point *p, mpz_t x, mpz_t y)
{ {
mp_size_t size = p->ecc->size; mp_size_t size = p->ecc->size;
if (x)
mpz_set_n (x, p->p, size); mpz_set_n (x, p->p, size);
if (y)
mpz_set_n (y, p->p + size, size); mpz_set_n (y, p->p + size, size);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment