comparison src/jdk.crypto.ec/share/native/libsunec/impl/ecl.h @ 17280:f09a6beb1e23

8175110: Higher quality ECDSA operations Reviewed-by: jnimeh, valeriep, vinnie, xuelei
author apetcher Fri, 12 May 2017 17:30:47 +0100 f08705540498
comparison
equal inserted replaced
0:842ddf363431 1:7c833f02603b
1 /* 1 /*
3 * Use is subject to license terms. 3 * Use is subject to license terms.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public 6 * modify it under the terms of the GNU Lesser General Public
32 * 32 *
33 * Contributor(s): 33 * Contributor(s):
34 * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories 34 * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
35 * 35 *
36 *********************************************************************** */ 37 *********************************************************************** */
37 38
38 #ifndef _ECL_H 39 #ifndef _ECL_H
39 #define _ECL_H 40 #define _ECL_H
40 41
68 /* Elliptic curve scalar-point multiplication. Computes Q(x, y) = k * P(x, 69 /* Elliptic curve scalar-point multiplication. Computes Q(x, y) = k * P(x,
69 * y). If x, y = NULL, then P is assumed to be the generator (base point) 70 * y). If x, y = NULL, then P is assumed to be the generator (base point)
70 * of the group of points on the elliptic curve. Input and output values 71 * of the group of points on the elliptic curve. Input and output values
71 * are assumed to be NOT field-encoded. */ 72 * are assumed to be NOT field-encoded. */
72 mp_err ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px, 73 mp_err ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px,
73 const mp_int *py, mp_int *qx, mp_int *qy); 74 const mp_int *py, mp_int *qx, mp_int *qy,
75 int timing);
74 76
75 /* Elliptic curve scalar-point multiplication. Computes Q(x, y) = k1 * G + 77 /* Elliptic curve scalar-point multiplication. Computes Q(x, y) = k1 * G +
76 * k2 * P(x, y), where G is the generator (base point) of the group of 78 * k2 * P(x, y), where G is the generator (base point) of the group of
77 * points on the elliptic curve. Input and output values are assumed to 79 * points on the elliptic curve. Input and output values are assumed to
78 * be NOT field-encoded. */ 80 * be NOT field-encoded. */
79 mp_err ECPoints_mul(const ECGroup *group, const mp_int *k1, 81 mp_err ECPoints_mul(const ECGroup *group, const mp_int *k1,
80 const mp_int *k2, const mp_int *px, const mp_int *py, 82 const mp_int *k2, const mp_int *px, const mp_int *py,
81 mp_int *qx, mp_int *qy); 83 mp_int *qx, mp_int *qy, int timing);
82 84
83 /* Validates an EC public key as described in Section 5.2.2 of X9.62. 85 /* Validates an EC public key as described in Section 5.2.2 of X9.62.
84 * Returns MP_YES if the public key is valid, MP_NO if the public key 86 * Returns MP_YES if the public key is valid, MP_NO if the public key
85 * is invalid, or an error code if the validation could not be 87 * is invalid, or an error code if the validation could not be
86 * performed. */ 88 * performed. */