diff --git a/ecc.h b/ecc.h index b78e86d..07d8bc8 100644 --- a/ecc.h +++ b/ecc.h @@ -124,6 +124,14 @@ ecc_point_mul (struct ecc_point *r, const struct ecc_scalar *n, void ecc_point_mul_g (struct ecc_point *r, const struct ecc_scalar *n); +/* Returns the size in bytes needed to store a coordinate of the curve. + */ +inline static unsigned +ecc_coordinate_size (const struct ecc_curve *ecc) +{ + return (ecc->bit_size+7)/8; +} + /* Low-level interface */