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.
James Prestwood authored 2 years ago
Denis Kenzior committed 2 years ago
733 | 733 |
return p->curve->ndigits * 8;
|
734 | 734 |
}
|
735 | 735 |
|
|
736 |
LIB_EXPORT bool l_ecc_point_y_isodd(const struct l_ecc_point *p)
|
|
737 |
{
|
|
738 |
return p->y[0] & 1;
|
|
739 |
}
|
|
740 |
|
736 | 741 |
LIB_EXPORT ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf,
|
737 | 742 |
size_t len)
|
738 | 743 |
{
|
68 | 68 |
const struct l_ecc_curve *l_ecc_point_get_curve(const struct l_ecc_point *p);
|
69 | 69 |
ssize_t l_ecc_point_get_x(const struct l_ecc_point *p, void *x, size_t xlen);
|
70 | 70 |
ssize_t l_ecc_point_get_y(const struct l_ecc_point *p, void *y, size_t ylen);
|
|
71 |
bool l_ecc_point_y_isodd(const struct l_ecc_point *p);
|
71 | 72 |
|
72 | 73 |
ssize_t l_ecc_point_get_data(const struct l_ecc_point *p, void *buf, size_t len);
|
73 | 74 |
void l_ecc_point_free(struct l_ecc_point *p);
|