Commit c33b0ea6 authored by Niels Möller's avatar Niels Möller

Comment fixes.

parent 1a6bd65f
...@@ -68,9 +68,10 @@ ecc_eh_to_a (const struct ecc_curve *ecc, ...@@ -68,9 +68,10 @@ ecc_eh_to_a (const struct ecc_curve *ecc,
/* Skip y coordinate */ /* Skip y coordinate */
if (op > 1) if (op > 1)
{ {
/* Reduce modulo q. FIXME: Hardcoded for curve25519, /* Reduce modulo q. Hardcoded for curve25519, duplicates end
duplicates end of ecc_25519_modq. FIXME: Is this needed of ecc_25519_modq. FIXME: Is this needed at all? op > 0
at all? Full reduction mod p is maybe sufficient. */ is only used by ecdsa code, and ecdsa on Edwards curves
makes little sense and is is only used by tests. */
unsigned shift; unsigned shift;
assert (ecc->p.bit_size == 255); assert (ecc->p.bit_size == 255);
shift = ecc->q.bit_size - 1 - GMP_NUMB_BITS * (ecc->p.size - 1); shift = ecc->q.bit_size - 1 - GMP_NUMB_BITS * (ecc->p.size - 1);
......
...@@ -283,17 +283,16 @@ ecc_a_to_j (const struct ecc_curve *ecc, ...@@ -283,17 +283,16 @@ ecc_a_to_j (const struct ecc_curve *ecc,
/* Converts a point P in jacobian coordinates into a point R in affine /* Converts a point P in jacobian coordinates into a point R in affine
coordinates. If op == 1, produce x coordinate only. If op == 2, coordinates. If op == 1, produce x coordinate only. If op == 2,
produce the x coordiante only, and in also it modulo q. FIXME: For produce the x coordinate only, and also reduce it modulo q. */
the public interface, have separate for the three cases, and use
this flag argument only for the internal ecc->h_to_a function. */
void void
ecc_j_to_a (const struct ecc_curve *ecc, ecc_j_to_a (const struct ecc_curve *ecc,
int op, int op,
mp_limb_t *r, const mp_limb_t *p, mp_limb_t *r, const mp_limb_t *p,
mp_limb_t *scratch); mp_limb_t *scratch);
/* Converts a point P on an Edwards curve to affine coordinates on /* Converts a point P in homogeneous coordinates on an Edwards curve
the corresponding Montgomery curve. */ to affine coordinates. Meaning of op is the same as for
ecc_j_to_a. */
void void
ecc_eh_to_a (const struct ecc_curve *ecc, ecc_eh_to_a (const struct ecc_curve *ecc,
int op, int op,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment