ecc: add l_ecc_point_y_isodd
James Prestwood
PATCH 1/1 ecc: add l_ecc_point_y_isodd
This is required to know how a compressed point will be interpreted after sending the raw (compressed) X coordiate.
--- ell/ecc.c | 5 +++++ ell/ecc.h | 1 + ell/ell.sym | 1 + 3 files changed, 7 insertions(+)
ell/ecc.c +5 -0
@@ -735,6 +735,11 @@ LIB_EXPORT ssize_t l_ecc_point_get_y(const struct l_ecc_point *p, void *y,return p->curve->ndigits *8 ; } +LIB_EXPORT bool l_ecc_point_y_isodd(const struct l_ecc_point *p) +{ +return p->y[0 ] &1 ; +} + LIB_EXPORT ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf,size_t len) {
ell/ecc.h +1 -0
@@ -69,6 +69,7 @@ struct l_ecc_point *l_ecc_point_clone(const struct l_ecc_point *p);const struct l_ecc_curve *l_ecc_point_get_curve (const struct l_ecc_point *p);ssize_t l_ecc_point_get_x (const struct l_ecc_point *p,void *x,size_t xlen);ssize_t l_ecc_point_get_y (const struct l_ecc_point *p,void *y,size_t ylen); +bool l_ecc_point_y_isodd (const struct l_ecc_point *p);ssize_t l_ecc_point_get_data (const struct l_ecc_point *p,void *buf,size_t len);void l_ecc_point_free (struct l_ecc_point *p);
ell/ell.sym +1 -0
@@ -572,6 +572,7 @@ global: l_ecc_point_from_data; l_ecc_point_get_x; l_ecc_point_get_y; + l_ecc_point_y_isodd; l_ecc_point_get_data; l_ecc_point_inverse; l_ecc_point_multiply;
Signature · 1 line
2.31.1
Denis Kenzior
AppliedHi James,
Quoted 8 lines · James Prestwood
This is required to know how a compressed point will be interpreted after sending the raw (compressed) X coordiate.
--- ell/ecc.c | 5 +++++ ell/ecc.h | 1 + ell/ell.sym | 1 + 3 files changed, 7 insertions(+)
Applied, thanks.
Regards,
-Denis