Lines Matching refs:wNAF
71 * This file implements the wNAF-based interleaving multi-exponentation method
73 * for multiplication with precomputation, we use wNAF splitting
80 size_t blocksize; /* block size for wNAF splitting */
177 * Determine the modified width-(w+1) Non-Adjacent Form (wNAF) of 'scalar'.
224 r = OPENSSL_malloc(len + 1); /* modified wNAF may be one digit longer
247 #if 1 /* modified wNAF */
271 * now window_val is 0 or 2^(w+1) in standard wNAF generation;
310 * TODO: table should be optimised for the wNAF-based implementation,
338 size_t blocksize = 0, numblocks = 0; /* for wNAF splitting */
345 signed char **wNAF = NULL; /* individual wNAFs */
400 * determine maximum number of blocks that wNAF splitting may
401 * yield (NB: maximum wNAF length is bit length plus one)
431 wNAF = OPENSSL_malloc((totalnum + 1) * sizeof wNAF[0]); /* includes space
435 /* Ensure wNAF is initialised in case we end up going to err */
436 if (wNAF)
437 wNAF[0] = NULL; /* preliminary pivot */
439 if (!wsize || !wNAF_len || !wNAF || !val_sub) {
455 wNAF[i + 1] = NULL; /* make sure we always have a pivot */
456 wNAF[i] =
459 if (wNAF[i] == NULL)
473 /* we have already generated a wNAF for 'scalar' */
493 * One of the other wNAFs is at least as long as the wNAF
494 * belonging to the generator, so wNAF splitting will not buy
499 totalnum = num + 1; /* don't use wNAF splitting */
500 wNAF[num] = tmp_wNAF;
501 wNAF[num + 1] = NULL;
511 * don't include tmp_wNAF directly into wNAF array - use wNAF
530 /* split wNAF in 'numblocks' parts */
549 wNAF[i + 1] = NULL;
550 wNAF[i] = OPENSSL_malloc(wNAF_len[i]);
551 if (wNAF[i] == NULL) {
556 memcpy(wNAF[i], pp, wNAF_len[i]);
648 int digit = wNAF[i][k];
701 if (wNAF != NULL) {
704 for (w = wNAF; *w != NULL; w++)
707 OPENSSL_free(wNAF);
724 * for use with wNAF splitting as implemented in ec_wNAF_mul().
798 * to use for wNAF