On 04/04/2013 06:15 PM, Niels Möller wrote:

> Checked in now. I think I have all Martin's patches in now (let me know
> if I forgot something). It would be good if you or Martin could check if
> it works with older gmp releases now.

> * I added the ecc_point_mul and ecc_point_mul_g functions (but testcases

>   missing).

Thank you. A utility function such as the attached is also quite useful.

regards,
Nikos
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 */
   
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to