components/tcl/tcl/patches/3.goto-label.patch
changeset 225 2f3e03a69313
equal deleted inserted replaced
224:b0ca638fab1b 225:2f3e03a69313
       
     1 --- tcl8.5.9/libtommath/bn_mp_div.c.orig	Tue Apr 26 08:26:45 2011
       
     2 +++ tcl8.5.9/libtommath/bn_mp_div.c	Tue Apr 26 08:26:45 2011
       
     3 @@ -53,7 +53,7 @@
       
     4        ((res = mp_abs(b, &tb)) != MP_OKAY) || 
       
     5        ((res = mp_mul_2d(&tb, n, &tb)) != MP_OKAY) ||
       
     6        ((res = mp_mul_2d(&tq, n, &tq)) != MP_OKAY)) {
       
     7 -      goto LBL_ERR;
       
     8 +      goto LBL_ERR_label;
       
     9    }
       
    10  
       
    11    while (n-- >= 0) {
       
    12 @@ -60,12 +60,12 @@
       
    13       if (mp_cmp(&tb, &ta) != MP_GT) {
       
    14          if (((res = mp_sub(&ta, &tb, &ta)) != MP_OKAY) ||
       
    15              ((res = mp_add(&q, &tq, &q)) != MP_OKAY)) {
       
    16 -           goto LBL_ERR;
       
    17 +           goto LBL_ERR_label;
       
    18          }
       
    19       }
       
    20       if (((res = mp_div_2d(&tb, 1, &tb, NULL)) != MP_OKAY) ||
       
    21           ((res = mp_div_2d(&tq, 1, &tq, NULL)) != MP_OKAY)) {
       
    22 -           goto LBL_ERR;
       
    23 +           goto LBL_ERR_label;
       
    24       }
       
    25    }
       
    26  
       
    27 @@ -80,7 +80,7 @@
       
    28       mp_exch(d, &ta);
       
    29       d->sign = (mp_iszero(d) == MP_YES) ? MP_ZPOS : n;
       
    30    }
       
    31 -LBL_ERR:
       
    32 +LBL_ERR_label:
       
    33     mp_clear_multi(&ta, &tb, &tq, &q, NULL);
       
    34     return res;
       
    35  }
       
    36 --- tcl8.5.9/libtommath/bn_mp_karatsuba_mul.c.orig	Tue Apr 26 08:26:45 2011
       
    37 +++ tcl8.5.9/libtommath/bn_mp_karatsuba_mul.c	Tue Apr 26 08:26:45 2011
       
    38 @@ -60,7 +60,7 @@
       
    39  
       
    40    /* init copy all the temps */
       
    41    if (mp_init_size (&x0, B) != MP_OKAY)
       
    42 -    goto ERR;
       
    43 +    goto ERR_label;
       
    44    if (mp_init_size (&x1, a->used - B) != MP_OKAY)
       
    45      goto X0;
       
    46    if (mp_init_size (&y0, B) != MP_OKAY)
       
    47 @@ -157,7 +157,7 @@
       
    48  Y0:mp_clear (&y0);
       
    49  X1:mp_clear (&x1);
       
    50  X0:mp_clear (&x0);
       
    51 -ERR:
       
    52 +ERR_label:
       
    53    return err;
       
    54  }
       
    55  #endif
       
    56 --- tcl8.5.9/libtommath/bn_mp_karatsuba_sqr.c.orig	Tue Apr 26 08:26:45 2011
       
    57 +++ tcl8.5.9/libtommath/bn_mp_karatsuba_sqr.c	Tue Apr 26 08:26:45 2011
       
    58 @@ -37,7 +37,7 @@
       
    59  
       
    60    /* init copy all the temps */
       
    61    if (mp_init_size (&x0, B) != MP_OKAY)
       
    62 -    goto ERR;
       
    63 +    goto ERR_label;
       
    64    if (mp_init_size (&x1, a->used - B) != MP_OKAY)
       
    65      goto X0;
       
    66  
       
    67 @@ -111,7 +111,7 @@
       
    68  T1:mp_clear (&t1);
       
    69  X1:mp_clear (&x1);
       
    70  X0:mp_clear (&x0);
       
    71 -ERR:
       
    72 +ERR_label:
       
    73    return err;
       
    74  }
       
    75  #endif
       
    76 --- tcl8.5.9/libtommath/bn_mp_toom_mul.c.orig	Tue Apr 26 08:26:45 2011
       
    77 +++ tcl8.5.9/libtommath/bn_mp_toom_mul.c	Tue Apr 26 08:26:45 2011
       
    78 @@ -39,124 +39,124 @@
       
    79      
       
    80      /* a = a2 * B**2 + a1 * B + a0 */
       
    81      if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) {
       
    82 -       goto ERR;
       
    83 +       goto ERR_label;
       
    84      }
       
    85  
       
    86      if ((res = mp_copy(a, &a1)) != MP_OKAY) {
       
    87 -       goto ERR;
       
    88 +       goto ERR_label;
       
    89      }
       
    90      mp_rshd(&a1, B);
       
    91      mp_mod_2d(&a1, DIGIT_BIT * B, &a1);
       
    92  
       
    93      if ((res = mp_copy(a, &a2)) != MP_OKAY) {
       
    94 -       goto ERR;
       
    95 +       goto ERR_label;
       
    96      }
       
    97      mp_rshd(&a2, B*2);
       
    98      
       
    99      /* b = b2 * B**2 + b1 * B + b0 */
       
   100      if ((res = mp_mod_2d(b, DIGIT_BIT * B, &b0)) != MP_OKAY) {
       
   101 -       goto ERR;
       
   102 +       goto ERR_label;
       
   103      }
       
   104  
       
   105      if ((res = mp_copy(b, &b1)) != MP_OKAY) {
       
   106 -       goto ERR;
       
   107 +       goto ERR_label;
       
   108      }
       
   109      mp_rshd(&b1, B);
       
   110      mp_mod_2d(&b1, DIGIT_BIT * B, &b1);
       
   111  
       
   112      if ((res = mp_copy(b, &b2)) != MP_OKAY) {
       
   113 -       goto ERR;
       
   114 +       goto ERR_label;
       
   115      }
       
   116      mp_rshd(&b2, B*2);
       
   117      
       
   118      /* w0 = a0*b0 */
       
   119      if ((res = mp_mul(&a0, &b0, &w0)) != MP_OKAY) {
       
   120 -       goto ERR;
       
   121 +       goto ERR_label;
       
   122      }
       
   123      
       
   124      /* w4 = a2 * b2 */
       
   125      if ((res = mp_mul(&a2, &b2, &w4)) != MP_OKAY) {
       
   126 -       goto ERR;
       
   127 +       goto ERR_label;
       
   128      }
       
   129      
       
   130      /* w1 = (a2 + 2(a1 + 2a0))(b2 + 2(b1 + 2b0)) */
       
   131      if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) {
       
   132 -       goto ERR;
       
   133 +       goto ERR_label;
       
   134      }
       
   135      if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
       
   136 -       goto ERR;
       
   137 +       goto ERR_label;
       
   138      }
       
   139      if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
       
   140 -       goto ERR;
       
   141 +       goto ERR_label;
       
   142      }
       
   143      if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) {
       
   144 -       goto ERR;
       
   145 +       goto ERR_label;
       
   146      }
       
   147      
       
   148      if ((res = mp_mul_2(&b0, &tmp2)) != MP_OKAY) {
       
   149 -       goto ERR;
       
   150 +       goto ERR_label;
       
   151      }
       
   152      if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) {
       
   153 -       goto ERR;
       
   154 +       goto ERR_label;
       
   155      }
       
   156      if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) {
       
   157 -       goto ERR;
       
   158 +       goto ERR_label;
       
   159      }
       
   160      if ((res = mp_add(&tmp2, &b2, &tmp2)) != MP_OKAY) {
       
   161 -       goto ERR;
       
   162 +       goto ERR_label;
       
   163      }
       
   164      
       
   165      if ((res = mp_mul(&tmp1, &tmp2, &w1)) != MP_OKAY) {
       
   166 -       goto ERR;
       
   167 +       goto ERR_label;
       
   168      }
       
   169      
       
   170      /* w3 = (a0 + 2(a1 + 2a2))(b0 + 2(b1 + 2b2)) */
       
   171      if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) {
       
   172 -       goto ERR;
       
   173 +       goto ERR_label;
       
   174      }
       
   175      if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
       
   176 -       goto ERR;
       
   177 +       goto ERR_label;
       
   178      }
       
   179      if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
       
   180 -       goto ERR;
       
   181 +       goto ERR_label;
       
   182      }
       
   183      if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
       
   184 -       goto ERR;
       
   185 +       goto ERR_label;
       
   186      }
       
   187      
       
   188      if ((res = mp_mul_2(&b2, &tmp2)) != MP_OKAY) {
       
   189 -       goto ERR;
       
   190 +       goto ERR_label;
       
   191      }
       
   192      if ((res = mp_add(&tmp2, &b1, &tmp2)) != MP_OKAY) {
       
   193 -       goto ERR;
       
   194 +       goto ERR_label;
       
   195      }
       
   196      if ((res = mp_mul_2(&tmp2, &tmp2)) != MP_OKAY) {
       
   197 -       goto ERR;
       
   198 +       goto ERR_label;
       
   199      }
       
   200      if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) {
       
   201 -       goto ERR;
       
   202 +       goto ERR_label;
       
   203      }
       
   204      
       
   205      if ((res = mp_mul(&tmp1, &tmp2, &w3)) != MP_OKAY) {
       
   206 -       goto ERR;
       
   207 +       goto ERR_label;
       
   208      }
       
   209      
       
   210  
       
   211      /* w2 = (a2 + a1 + a0)(b2 + b1 + b0) */
       
   212      if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) {
       
   213 -       goto ERR;
       
   214 +       goto ERR_label;
       
   215      }
       
   216      if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
       
   217 -       goto ERR;
       
   218 +       goto ERR_label;
       
   219      }
       
   220      if ((res = mp_add(&b2, &b1, &tmp2)) != MP_OKAY) {
       
   221 -       goto ERR;
       
   222 +       goto ERR_label;
       
   223      }
       
   224      if ((res = mp_add(&tmp2, &b0, &tmp2)) != MP_OKAY) {
       
   225 -       goto ERR;
       
   226 +       goto ERR_label;
       
   227      }
       
   228      if ((res = mp_mul(&tmp1, &tmp2, &w2)) != MP_OKAY) {
       
   229 -       goto ERR;
       
   230 +       goto ERR_label;
       
   231      }
       
   232      
       
   233      /* now solve the matrix 
       
   234 @@ -173,104 +173,104 @@
       
   235       
       
   236       /* r1 - r4 */
       
   237       if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) {
       
   238 -        goto ERR;
       
   239 +        goto ERR_label;
       
   240       }
       
   241       /* r3 - r0 */
       
   242       if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) {
       
   243 -        goto ERR;
       
   244 +        goto ERR_label;
       
   245       }
       
   246       /* r1/2 */
       
   247       if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) {
       
   248 -        goto ERR;
       
   249 +        goto ERR_label;
       
   250       }
       
   251       /* r3/2 */
       
   252       if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) {
       
   253 -        goto ERR;
       
   254 +        goto ERR_label;
       
   255       }
       
   256       /* r2 - r0 - r4 */
       
   257       if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) {
       
   258 -        goto ERR;
       
   259 +        goto ERR_label;
       
   260       }
       
   261       if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) {
       
   262 -        goto ERR;
       
   263 +        goto ERR_label;
       
   264       }
       
   265       /* r1 - r2 */
       
   266       if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
       
   267 -        goto ERR;
       
   268 +        goto ERR_label;
       
   269       }
       
   270       /* r3 - r2 */
       
   271       if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
       
   272 -        goto ERR;
       
   273 +        goto ERR_label;
       
   274       }
       
   275       /* r1 - 8r0 */
       
   276       if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) {
       
   277 -        goto ERR;
       
   278 +        goto ERR_label;
       
   279       }
       
   280       if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) {
       
   281 -        goto ERR;
       
   282 +        goto ERR_label;
       
   283       }
       
   284       /* r3 - 8r4 */
       
   285       if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) {
       
   286 -        goto ERR;
       
   287 +        goto ERR_label;
       
   288       }
       
   289       if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) {
       
   290 -        goto ERR;
       
   291 +        goto ERR_label;
       
   292       }
       
   293       /* 3r2 - r1 - r3 */
       
   294       if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) {
       
   295 -        goto ERR;
       
   296 +        goto ERR_label;
       
   297       }
       
   298       if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) {
       
   299 -        goto ERR;
       
   300 +        goto ERR_label;
       
   301       }
       
   302       if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) {
       
   303 -        goto ERR;
       
   304 +        goto ERR_label;
       
   305       }
       
   306       /* r1 - r2 */
       
   307       if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
       
   308 -        goto ERR;
       
   309 +        goto ERR_label;
       
   310       }
       
   311       /* r3 - r2 */
       
   312       if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
       
   313 -        goto ERR;
       
   314 +        goto ERR_label;
       
   315       }
       
   316       /* r1/3 */
       
   317       if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) {
       
   318 -        goto ERR;
       
   319 +        goto ERR_label;
       
   320       }
       
   321       /* r3/3 */
       
   322       if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) {
       
   323 -        goto ERR;
       
   324 +        goto ERR_label;
       
   325       }
       
   326       
       
   327       /* at this point shift W[n] by B*n */
       
   328       if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) {
       
   329 -        goto ERR;
       
   330 +        goto ERR_label;
       
   331       }
       
   332       if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) {
       
   333 -        goto ERR;
       
   334 +        goto ERR_label;
       
   335       }
       
   336       if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) {
       
   337 -        goto ERR;
       
   338 +        goto ERR_label;
       
   339       }
       
   340       if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) {
       
   341 -        goto ERR;
       
   342 +        goto ERR_label;
       
   343       }     
       
   344       
       
   345       if ((res = mp_add(&w0, &w1, c)) != MP_OKAY) {
       
   346 -        goto ERR;
       
   347 +        goto ERR_label;
       
   348       }
       
   349       if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) {
       
   350 -        goto ERR;
       
   351 +        goto ERR_label;
       
   352       }
       
   353       if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) {
       
   354 -        goto ERR;
       
   355 +        goto ERR_label;
       
   356       }
       
   357       if ((res = mp_add(&tmp1, c, c)) != MP_OKAY) {
       
   358 -        goto ERR;
       
   359 +        goto ERR_label;
       
   360       }     
       
   361       
       
   362 -ERR:
       
   363 +ERR_label:
       
   364       mp_clear_multi(&w0, &w1, &w2, &w3, &w4, 
       
   365                      &a0, &a1, &a2, &b0, &b1, 
       
   366                      &b2, &tmp1, &tmp2, NULL);
       
   367 --- tcl8.5.9/libtommath/bn_mp_toom_sqr.c.orig	Tue Apr 26 08:26:45 2011
       
   368 +++ tcl8.5.9/libtommath/bn_mp_toom_sqr.c	Tue Apr 26 08:26:45 2011
       
   369 @@ -32,76 +32,76 @@
       
   370  
       
   371      /* a = a2 * B**2 + a1 * B + a0 */
       
   372      if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) {
       
   373 -       goto ERR;
       
   374 +       goto ERR_label;
       
   375      }
       
   376  
       
   377      if ((res = mp_copy(a, &a1)) != MP_OKAY) {
       
   378 -       goto ERR;
       
   379 +       goto ERR_label;
       
   380      }
       
   381      mp_rshd(&a1, B);
       
   382      mp_mod_2d(&a1, DIGIT_BIT * B, &a1);
       
   383  
       
   384      if ((res = mp_copy(a, &a2)) != MP_OKAY) {
       
   385 -       goto ERR;
       
   386 +       goto ERR_label;
       
   387      }
       
   388      mp_rshd(&a2, B*2);
       
   389  
       
   390      /* w0 = a0*a0 */
       
   391      if ((res = mp_sqr(&a0, &w0)) != MP_OKAY) {
       
   392 -       goto ERR;
       
   393 +       goto ERR_label;
       
   394      }
       
   395  
       
   396      /* w4 = a2 * a2 */
       
   397      if ((res = mp_sqr(&a2, &w4)) != MP_OKAY) {
       
   398 -       goto ERR;
       
   399 +       goto ERR_label;
       
   400      }
       
   401  
       
   402      /* w1 = (a2 + 2(a1 + 2a0))**2 */
       
   403      if ((res = mp_mul_2(&a0, &tmp1)) != MP_OKAY) {
       
   404 -       goto ERR;
       
   405 +       goto ERR_label;
       
   406      }
       
   407      if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
       
   408 -       goto ERR;
       
   409 +       goto ERR_label;
       
   410      }
       
   411      if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
       
   412 -       goto ERR;
       
   413 +       goto ERR_label;
       
   414      }
       
   415      if ((res = mp_add(&tmp1, &a2, &tmp1)) != MP_OKAY) {
       
   416 -       goto ERR;
       
   417 +       goto ERR_label;
       
   418      }
       
   419  
       
   420      if ((res = mp_sqr(&tmp1, &w1)) != MP_OKAY) {
       
   421 -       goto ERR;
       
   422 +       goto ERR_label;
       
   423      }
       
   424  
       
   425      /* w3 = (a0 + 2(a1 + 2a2))**2 */
       
   426      if ((res = mp_mul_2(&a2, &tmp1)) != MP_OKAY) {
       
   427 -       goto ERR;
       
   428 +       goto ERR_label;
       
   429      }
       
   430      if ((res = mp_add(&tmp1, &a1, &tmp1)) != MP_OKAY) {
       
   431 -       goto ERR;
       
   432 +       goto ERR_label;
       
   433      }
       
   434      if ((res = mp_mul_2(&tmp1, &tmp1)) != MP_OKAY) {
       
   435 -       goto ERR;
       
   436 +       goto ERR_label;
       
   437      }
       
   438      if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
       
   439 -       goto ERR;
       
   440 +       goto ERR_label;
       
   441      }
       
   442  
       
   443      if ((res = mp_sqr(&tmp1, &w3)) != MP_OKAY) {
       
   444 -       goto ERR;
       
   445 +       goto ERR_label;
       
   446      }
       
   447  
       
   448  
       
   449      /* w2 = (a2 + a1 + a0)**2 */
       
   450      if ((res = mp_add(&a2, &a1, &tmp1)) != MP_OKAY) {
       
   451 -       goto ERR;
       
   452 +       goto ERR_label;
       
   453      }
       
   454      if ((res = mp_add(&tmp1, &a0, &tmp1)) != MP_OKAY) {
       
   455 -       goto ERR;
       
   456 +       goto ERR_label;
       
   457      }
       
   458      if ((res = mp_sqr(&tmp1, &w2)) != MP_OKAY) {
       
   459 -       goto ERR;
       
   460 +       goto ERR_label;
       
   461      }
       
   462  
       
   463      /* now solve the matrix
       
   464 @@ -117,104 +117,104 @@
       
   465  
       
   466       /* r1 - r4 */
       
   467       if ((res = mp_sub(&w1, &w4, &w1)) != MP_OKAY) {
       
   468 -        goto ERR;
       
   469 +        goto ERR_label;
       
   470       }
       
   471       /* r3 - r0 */
       
   472       if ((res = mp_sub(&w3, &w0, &w3)) != MP_OKAY) {
       
   473 -        goto ERR;
       
   474 +        goto ERR_label;
       
   475       }
       
   476       /* r1/2 */
       
   477       if ((res = mp_div_2(&w1, &w1)) != MP_OKAY) {
       
   478 -        goto ERR;
       
   479 +        goto ERR_label;
       
   480       }
       
   481       /* r3/2 */
       
   482       if ((res = mp_div_2(&w3, &w3)) != MP_OKAY) {
       
   483 -        goto ERR;
       
   484 +        goto ERR_label;
       
   485       }
       
   486       /* r2 - r0 - r4 */
       
   487       if ((res = mp_sub(&w2, &w0, &w2)) != MP_OKAY) {
       
   488 -        goto ERR;
       
   489 +        goto ERR_label;
       
   490       }
       
   491       if ((res = mp_sub(&w2, &w4, &w2)) != MP_OKAY) {
       
   492 -        goto ERR;
       
   493 +        goto ERR_label;
       
   494       }
       
   495       /* r1 - r2 */
       
   496       if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
       
   497 -        goto ERR;
       
   498 +        goto ERR_label;
       
   499       }
       
   500       /* r3 - r2 */
       
   501       if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
       
   502 -        goto ERR;
       
   503 +        goto ERR_label;
       
   504       }
       
   505       /* r1 - 8r0 */
       
   506       if ((res = mp_mul_2d(&w0, 3, &tmp1)) != MP_OKAY) {
       
   507 -        goto ERR;
       
   508 +        goto ERR_label;
       
   509       }
       
   510       if ((res = mp_sub(&w1, &tmp1, &w1)) != MP_OKAY) {
       
   511 -        goto ERR;
       
   512 +        goto ERR_label;
       
   513       }
       
   514       /* r3 - 8r4 */
       
   515       if ((res = mp_mul_2d(&w4, 3, &tmp1)) != MP_OKAY) {
       
   516 -        goto ERR;
       
   517 +        goto ERR_label;
       
   518       }
       
   519       if ((res = mp_sub(&w3, &tmp1, &w3)) != MP_OKAY) {
       
   520 -        goto ERR;
       
   521 +        goto ERR_label;
       
   522       }
       
   523       /* 3r2 - r1 - r3 */
       
   524       if ((res = mp_mul_d(&w2, 3, &w2)) != MP_OKAY) {
       
   525 -        goto ERR;
       
   526 +        goto ERR_label;
       
   527       }
       
   528       if ((res = mp_sub(&w2, &w1, &w2)) != MP_OKAY) {
       
   529 -        goto ERR;
       
   530 +        goto ERR_label;
       
   531       }
       
   532       if ((res = mp_sub(&w2, &w3, &w2)) != MP_OKAY) {
       
   533 -        goto ERR;
       
   534 +        goto ERR_label;
       
   535       }
       
   536       /* r1 - r2 */
       
   537       if ((res = mp_sub(&w1, &w2, &w1)) != MP_OKAY) {
       
   538 -        goto ERR;
       
   539 +        goto ERR_label;
       
   540       }
       
   541       /* r3 - r2 */
       
   542       if ((res = mp_sub(&w3, &w2, &w3)) != MP_OKAY) {
       
   543 -        goto ERR;
       
   544 +        goto ERR_label;
       
   545       }
       
   546       /* r1/3 */
       
   547       if ((res = mp_div_3(&w1, &w1, NULL)) != MP_OKAY) {
       
   548 -        goto ERR;
       
   549 +        goto ERR_label;
       
   550       }
       
   551       /* r3/3 */
       
   552       if ((res = mp_div_3(&w3, &w3, NULL)) != MP_OKAY) {
       
   553 -        goto ERR;
       
   554 +        goto ERR_label;
       
   555       }
       
   556  
       
   557       /* at this point shift W[n] by B*n */
       
   558       if ((res = mp_lshd(&w1, 1*B)) != MP_OKAY) {
       
   559 -        goto ERR;
       
   560 +        goto ERR_label;
       
   561       }
       
   562       if ((res = mp_lshd(&w2, 2*B)) != MP_OKAY) {
       
   563 -        goto ERR;
       
   564 +        goto ERR_label;
       
   565       }
       
   566       if ((res = mp_lshd(&w3, 3*B)) != MP_OKAY) {
       
   567 -        goto ERR;
       
   568 +        goto ERR_label;
       
   569       }
       
   570       if ((res = mp_lshd(&w4, 4*B)) != MP_OKAY) {
       
   571 -        goto ERR;
       
   572 +        goto ERR_label;
       
   573       }
       
   574  
       
   575       if ((res = mp_add(&w0, &w1, b)) != MP_OKAY) {
       
   576 -        goto ERR;
       
   577 +        goto ERR_label;
       
   578       }
       
   579       if ((res = mp_add(&w2, &w3, &tmp1)) != MP_OKAY) {
       
   580 -        goto ERR;
       
   581 +        goto ERR_label;
       
   582       }
       
   583       if ((res = mp_add(&w4, &tmp1, &tmp1)) != MP_OKAY) {
       
   584 -        goto ERR;
       
   585 +        goto ERR_label;
       
   586       }
       
   587       if ((res = mp_add(&tmp1, b, b)) != MP_OKAY) {
       
   588 -        goto ERR;
       
   589 +        goto ERR_label;
       
   590       }
       
   591  
       
   592 -ERR:
       
   593 +ERR_label:
       
   594       mp_clear_multi(&w0, &w1, &w2, &w3, &w4, &a0, &a1, &a2, &tmp1, NULL);
       
   595       return res;
       
   596  }