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

8175110: Higher quality ECDSA operations Reviewed-by: jnimeh, valeriep, vinnie, xuelei
author apetcher
date Fri, 12 May 2017 17:30:47 +0100
parents f08705540498
children
comparison
equal deleted inserted replaced
0:e7cdb12f21d6 1:30f118d6337c
1 /* 1 /*
2 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
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
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
32 * 32 *
33 * Contributor(s): 33 * Contributor(s):
34 * Stephen Fung <fungstep@hotmail.com> and 34 * Stephen Fung <fungstep@hotmail.com> and
35 * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories 35 * Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
36 * 36 *
37 * Last Modified Date from the Original Code: May 2017
37 *********************************************************************** */ 38 *********************************************************************** */
38 39
39 #ifndef _ECL_PRIV_H 40 #ifndef _ECL_PRIV_H
40 #define _ECL_PRIV_H 41 #define _ECL_PRIV_H
41 42
191 mp_int *ry, const ECGroup *group); 192 mp_int *ry, const ECGroup *group);
192 mp_err (*point_dbl) (const mp_int *px, const mp_int *py, mp_int *rx, 193 mp_err (*point_dbl) (const mp_int *px, const mp_int *py, mp_int *rx,
193 mp_int *ry, const ECGroup *group); 194 mp_int *ry, const ECGroup *group);
194 mp_err (*point_mul) (const mp_int *n, const mp_int *px, 195 mp_err (*point_mul) (const mp_int *n, const mp_int *px,
195 const mp_int *py, mp_int *rx, mp_int *ry, 196 const mp_int *py, mp_int *rx, mp_int *ry,
196 const ECGroup *group); 197 const ECGroup *group, int timing);
197 mp_err (*base_point_mul) (const mp_int *n, mp_int *rx, mp_int *ry, 198 mp_err (*base_point_mul) (const mp_int *n, mp_int *rx, mp_int *ry,
198 const ECGroup *group); 199 const ECGroup *group);
199 mp_err (*points_mul) (const mp_int *k1, const mp_int *k2, 200 mp_err (*points_mul) (const mp_int *k1, const mp_int *k2,
200 const mp_int *px, const mp_int *py, mp_int *rx, 201 const mp_int *px, const mp_int *py, mp_int *rx,
201 mp_int *ry, const ECGroup *group); 202 mp_int *ry, const ECGroup *group,
203 int timing);
202 mp_err (*validate_point) (const mp_int *px, const mp_int *py, const ECGroup *group); 204 mp_err (*validate_point) (const mp_int *px, const mp_int *py, const ECGroup *group);
203 /* Extra storage for implementation-specific data. Any memory 205 /* Extra storage for implementation-specific data. Any memory
204 * allocated to these extra fields will be cleared by extra_free. */ 206 * allocated to these extra fields will be cleared by extra_free. */
205 void *extra1; 207 void *extra1;
206 void *extra2; 208 void *extra2;
260 void ec_GFp_extra_free_mont(GFMethod *meth); 262 void ec_GFp_extra_free_mont(GFMethod *meth);
261 263
262 /* point multiplication */ 264 /* point multiplication */
263 mp_err ec_pts_mul_basic(const mp_int *k1, const mp_int *k2, 265 mp_err ec_pts_mul_basic(const mp_int *k1, const mp_int *k2,
264 const mp_int *px, const mp_int *py, mp_int *rx, 266 const mp_int *px, const mp_int *py, mp_int *rx,
265 mp_int *ry, const ECGroup *group); 267 mp_int *ry, const ECGroup *group,
268 int timing);
266 mp_err ec_pts_mul_simul_w2(const mp_int *k1, const mp_int *k2, 269 mp_err ec_pts_mul_simul_w2(const mp_int *k1, const mp_int *k2,
267 const mp_int *px, const mp_int *py, mp_int *rx, 270 const mp_int *px, const mp_int *py, mp_int *rx,
268 mp_int *ry, const ECGroup *group); 271 mp_int *ry, const ECGroup *group,
272 int timing);
269 273
270 /* Computes the windowed non-adjacent-form (NAF) of a scalar. Out should 274 /* Computes the windowed non-adjacent-form (NAF) of a scalar. Out should
271 * be an array of signed char's to output to, bitsize should be the number 275 * be an array of signed char's to output to, bitsize should be the number
272 * of bits of out, in is the original scalar, and w is the window size. 276 * of bits of out, in is the original scalar, and w is the window size.
273 * NAF is discussed in the paper: D. Hankerson, J. Hernandez and A. 277 * NAF is discussed in the paper: D. Hankerson, J. Hernandez and A.