github.com/consensys/gnark-crypto@v0.14.0/ecc/secp256k1/fr/element_exp.go (about) 1 // Copyright 2020 ConsenSys Software Inc. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // Code generated by consensys/gnark-crypto DO NOT EDIT 16 17 package fr 18 19 // expBySqrtExp is equivalent to z.Exp(x, 1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4bd19a06c82) 20 // 21 // uses github.com/mmcloughlin/addchain v0.4.0 to generate a shorter addition chain 22 func (z *Element) expBySqrtExp(x Element) *Element { 23 // addition chain: 24 // 25 // _10 = 2*1 26 // _11 = 1 + _10 27 // _101 = _10 + _11 28 // _111 = _10 + _101 29 // _1001 = _10 + _111 30 // _1011 = _10 + _1001 31 // _1101 = _10 + _1011 32 // _1111 = _10 + _1101 33 // _1111000 = _1111 << 3 34 // _1111111 = _111 + _1111000 35 // _11111110 = 2*_1111111 36 // _11111111 = 1 + _11111110 37 // i21 = _11111111 << 7 38 // x15 = _1111111 + i21 39 // i30 = i21 << 8 40 // x23 = x15 + i30 41 // x31 = i30 << 8 + x23 42 // x32 = 2*x31 + 1 43 // x64 = x32 << 32 + x32 44 // x96 = x64 << 32 + x32 45 // x127 = x96 << 31 + x31 46 // i154 = ((x127 << 5 + _1011) << 3 + _101) << 4 47 // i166 = ((_101 + i154) << 4 + _111) << 5 + _1101 48 // i181 = ((i166 << 2 + _11) << 5 + _111) << 6 49 // i193 = ((_1101 + i181) << 5 + _1011) << 4 + _1101 50 // i214 = ((i193 << 3 + 1) << 6 + _101) << 10 51 // i230 = ((_111 + i214) << 4 + _111) << 9 + _11111111 52 // i247 = ((i230 << 5 + _1001) << 6 + _1011) << 4 53 // i261 = ((_1101 + i247) << 5 + _11) << 6 + _1101 54 // i283 = ((i261 << 10 + _1101) << 4 + _1001) << 6 55 // return 2*(1 + i283) 56 // 57 // Operations: 246 squares 39 multiplies 58 59 // Allocate Temporaries. 60 var ( 61 t0 = new(Element) 62 t1 = new(Element) 63 t2 = new(Element) 64 t3 = new(Element) 65 t4 = new(Element) 66 t5 = new(Element) 67 t6 = new(Element) 68 t7 = new(Element) 69 t8 = new(Element) 70 ) 71 72 // var t0,t1,t2,t3,t4,t5,t6,t7,t8 Element 73 // Step 1: t3 = x^0x2 74 t3.Square(&x) 75 76 // Step 2: t1 = x^0x3 77 t1.Mul(&x, t3) 78 79 // Step 3: t5 = x^0x5 80 t5.Mul(t3, t1) 81 82 // Step 4: t4 = x^0x7 83 t4.Mul(t3, t5) 84 85 // Step 5: z = x^0x9 86 z.Mul(t3, t4) 87 88 // Step 6: t2 = x^0xb 89 t2.Mul(t3, z) 90 91 // Step 7: t0 = x^0xd 92 t0.Mul(t3, t2) 93 94 // Step 8: t3 = x^0xf 95 t3.Mul(t3, t0) 96 97 // Step 11: t3 = x^0x78 98 for s := 0; s < 3; s++ { 99 t3.Square(t3) 100 } 101 102 // Step 12: t6 = x^0x7f 103 t6.Mul(t4, t3) 104 105 // Step 13: t3 = x^0xfe 106 t3.Square(t6) 107 108 // Step 14: t3 = x^0xff 109 t3.Mul(&x, t3) 110 111 // Step 21: t7 = x^0x7f80 112 t7.Square(t3) 113 for s := 1; s < 7; s++ { 114 t7.Square(t7) 115 } 116 117 // Step 22: t6 = x^0x7fff 118 t6.Mul(t6, t7) 119 120 // Step 30: t7 = x^0x7f8000 121 for s := 0; s < 8; s++ { 122 t7.Square(t7) 123 } 124 125 // Step 31: t6 = x^0x7fffff 126 t6.Mul(t6, t7) 127 128 // Step 39: t7 = x^0x7f800000 129 for s := 0; s < 8; s++ { 130 t7.Square(t7) 131 } 132 133 // Step 40: t6 = x^0x7fffffff 134 t6.Mul(t6, t7) 135 136 // Step 41: t7 = x^0xfffffffe 137 t7.Square(t6) 138 139 // Step 42: t7 = x^0xffffffff 140 t7.Mul(&x, t7) 141 142 // Step 74: t8 = x^0xffffffff00000000 143 t8.Square(t7) 144 for s := 1; s < 32; s++ { 145 t8.Square(t8) 146 } 147 148 // Step 75: t8 = x^0xffffffffffffffff 149 t8.Mul(t7, t8) 150 151 // Step 107: t8 = x^0xffffffffffffffff00000000 152 for s := 0; s < 32; s++ { 153 t8.Square(t8) 154 } 155 156 // Step 108: t7 = x^0xffffffffffffffffffffffff 157 t7.Mul(t7, t8) 158 159 // Step 139: t7 = x^0x7fffffffffffffffffffffff80000000 160 for s := 0; s < 31; s++ { 161 t7.Square(t7) 162 } 163 164 // Step 140: t6 = x^0x7fffffffffffffffffffffffffffffff 165 t6.Mul(t6, t7) 166 167 // Step 145: t6 = x^0xfffffffffffffffffffffffffffffffe0 168 for s := 0; s < 5; s++ { 169 t6.Square(t6) 170 } 171 172 // Step 146: t6 = x^0xfffffffffffffffffffffffffffffffeb 173 t6.Mul(t2, t6) 174 175 // Step 149: t6 = x^0x7fffffffffffffffffffffffffffffff58 176 for s := 0; s < 3; s++ { 177 t6.Square(t6) 178 } 179 180 // Step 150: t6 = x^0x7fffffffffffffffffffffffffffffff5d 181 t6.Mul(t5, t6) 182 183 // Step 154: t6 = x^0x7fffffffffffffffffffffffffffffff5d0 184 for s := 0; s < 4; s++ { 185 t6.Square(t6) 186 } 187 188 // Step 155: t6 = x^0x7fffffffffffffffffffffffffffffff5d5 189 t6.Mul(t5, t6) 190 191 // Step 159: t6 = x^0x7fffffffffffffffffffffffffffffff5d50 192 for s := 0; s < 4; s++ { 193 t6.Square(t6) 194 } 195 196 // Step 160: t6 = x^0x7fffffffffffffffffffffffffffffff5d57 197 t6.Mul(t4, t6) 198 199 // Step 165: t6 = x^0xfffffffffffffffffffffffffffffffebaae0 200 for s := 0; s < 5; s++ { 201 t6.Square(t6) 202 } 203 204 // Step 166: t6 = x^0xfffffffffffffffffffffffffffffffebaaed 205 t6.Mul(t0, t6) 206 207 // Step 168: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb4 208 for s := 0; s < 2; s++ { 209 t6.Square(t6) 210 } 211 212 // Step 169: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb7 213 t6.Mul(t1, t6) 214 215 // Step 174: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e0 216 for s := 0; s < 5; s++ { 217 t6.Square(t6) 218 } 219 220 // Step 175: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e7 221 t6.Mul(t4, t6) 222 223 // Step 181: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9c0 224 for s := 0; s < 6; s++ { 225 t6.Square(t6) 226 } 227 228 // Step 182: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd 229 t6.Mul(t0, t6) 230 231 // Step 187: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739a0 232 for s := 0; s < 5; s++ { 233 t6.Square(t6) 234 } 235 236 // Step 188: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739ab 237 t6.Mul(t2, t6) 238 239 // Step 192: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739ab0 240 for s := 0; s < 4; s++ { 241 t6.Square(t6) 242 } 243 244 // Step 193: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd 245 t6.Mul(t0, t6) 246 247 // Step 196: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e8 248 for s := 0; s < 3; s++ { 249 t6.Square(t6) 250 } 251 252 // Step 197: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9 253 t6.Mul(&x, t6) 254 255 // Step 203: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a40 256 for s := 0; s < 6; s++ { 257 t6.Square(t6) 258 } 259 260 // Step 204: t5 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a45 261 t5.Mul(t5, t6) 262 263 // Step 214: t5 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e91400 264 for s := 0; s < 10; s++ { 265 t5.Square(t5) 266 } 267 268 // Step 215: t5 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e91407 269 t5.Mul(t4, t5) 270 271 // Step 219: t5 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e914070 272 for s := 0; s < 4; s++ { 273 t5.Square(t5) 274 } 275 276 // Step 220: t4 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e914077 277 t4.Mul(t4, t5) 278 279 // Step 229: t4 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280ee00 280 for s := 0; s < 9; s++ { 281 t4.Square(t4) 282 } 283 284 // Step 230: t3 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff 285 t3.Mul(t3, t4) 286 287 // Step 235: t3 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe0 288 for s := 0; s < 5; s++ { 289 t3.Square(t3) 290 } 291 292 // Step 236: t3 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe9 293 t3.Mul(z, t3) 294 295 // Step 242: t3 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa40 296 for s := 0; s < 6; s++ { 297 t3.Square(t3) 298 } 299 300 // Step 243: t2 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4b 301 t2.Mul(t2, t3) 302 303 // Step 247: t2 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4b0 304 for s := 0; s < 4; s++ { 305 t2.Square(t2) 306 } 307 308 // Step 248: t2 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4bd 309 t2.Mul(t0, t2) 310 311 // Step 253: t2 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a0 312 for s := 0; s < 5; s++ { 313 t2.Square(t2) 314 } 315 316 // Step 254: t1 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3 317 t1.Mul(t1, t2) 318 319 // Step 260: t1 = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8c0 320 for s := 0; s < 6; s++ { 321 t1.Square(t1) 322 } 323 324 // Step 261: t1 = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd 325 t1.Mul(t0, t1) 326 327 // Step 271: t1 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a33400 328 for s := 0; s < 10; s++ { 329 t1.Square(t1) 330 } 331 332 // Step 272: t0 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d 333 t0.Mul(t0, t1) 334 335 // Step 276: t0 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d0 336 for s := 0; s < 4; s++ { 337 t0.Square(t0) 338 } 339 340 // Step 277: z = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d9 341 z.Mul(z, t0) 342 343 // Step 283: z = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03640 344 for s := 0; s < 6; s++ { 345 z.Square(z) 346 } 347 348 // Step 284: z = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd03641 349 z.Mul(&x, z) 350 351 // Step 285: z = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4bd19a06c82 352 z.Square(z) 353 354 return z 355 } 356 357 // expByLegendreExp is equivalent to z.Exp(x, 7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0) 358 // 359 // uses github.com/mmcloughlin/addchain v0.4.0 to generate a shorter addition chain 360 func (z *Element) expByLegendreExp(x Element) *Element { 361 // addition chain: 362 // 363 // _10 = 2*1 364 // _11 = 1 + _10 365 // _101 = _10 + _11 366 // _111 = _10 + _101 367 // _1001 = _10 + _111 368 // _1011 = _10 + _1001 369 // _1101 = _10 + _1011 370 // _1111 = _10 + _1101 371 // _1111000 = _1111 << 3 372 // _1111111 = _111 + _1111000 373 // _11111110 = 2*_1111111 374 // _11111111 = 1 + _11111110 375 // i21 = _11111111 << 7 376 // x15 = _1111111 + i21 377 // i30 = i21 << 8 378 // x23 = x15 + i30 379 // x31 = i30 << 8 + x23 380 // x32 = 2*x31 + 1 381 // x64 = x32 << 32 + x32 382 // x96 = x64 << 32 + x32 383 // x127 = x96 << 31 + x31 384 // i154 = ((x127 << 5 + _1011) << 3 + _101) << 4 385 // i166 = ((_101 + i154) << 4 + _111) << 5 + _1101 386 // i181 = ((i166 << 2 + _11) << 5 + _111) << 6 387 // i193 = ((_1101 + i181) << 5 + _1011) << 4 + _1101 388 // i214 = ((i193 << 3 + 1) << 6 + _101) << 10 389 // i230 = ((_111 + i214) << 4 + _111) << 9 + _11111111 390 // i247 = ((i230 << 5 + _1001) << 6 + _1011) << 4 391 // i261 = ((_1101 + i247) << 5 + _11) << 6 + _1101 392 // i285 = ((i261 << 10 + _1101) << 4 + _1001) << 8 393 // return (_101 + i285) << 5 394 // 395 // Operations: 252 squares 39 multiplies 396 397 // Allocate Temporaries. 398 var ( 399 t0 = new(Element) 400 t1 = new(Element) 401 t2 = new(Element) 402 t3 = new(Element) 403 t4 = new(Element) 404 t5 = new(Element) 405 t6 = new(Element) 406 t7 = new(Element) 407 t8 = new(Element) 408 ) 409 410 // var t0,t1,t2,t3,t4,t5,t6,t7,t8 Element 411 // Step 1: t4 = x^0x2 412 t4.Square(&x) 413 414 // Step 2: t2 = x^0x3 415 t2.Mul(&x, t4) 416 417 // Step 3: z = x^0x5 418 z.Mul(t4, t2) 419 420 // Step 4: t5 = x^0x7 421 t5.Mul(t4, z) 422 423 // Step 5: t0 = x^0x9 424 t0.Mul(t4, t5) 425 426 // Step 6: t3 = x^0xb 427 t3.Mul(t4, t0) 428 429 // Step 7: t1 = x^0xd 430 t1.Mul(t4, t3) 431 432 // Step 8: t4 = x^0xf 433 t4.Mul(t4, t1) 434 435 // Step 11: t4 = x^0x78 436 for s := 0; s < 3; s++ { 437 t4.Square(t4) 438 } 439 440 // Step 12: t6 = x^0x7f 441 t6.Mul(t5, t4) 442 443 // Step 13: t4 = x^0xfe 444 t4.Square(t6) 445 446 // Step 14: t4 = x^0xff 447 t4.Mul(&x, t4) 448 449 // Step 21: t7 = x^0x7f80 450 t7.Square(t4) 451 for s := 1; s < 7; s++ { 452 t7.Square(t7) 453 } 454 455 // Step 22: t6 = x^0x7fff 456 t6.Mul(t6, t7) 457 458 // Step 30: t7 = x^0x7f8000 459 for s := 0; s < 8; s++ { 460 t7.Square(t7) 461 } 462 463 // Step 31: t6 = x^0x7fffff 464 t6.Mul(t6, t7) 465 466 // Step 39: t7 = x^0x7f800000 467 for s := 0; s < 8; s++ { 468 t7.Square(t7) 469 } 470 471 // Step 40: t6 = x^0x7fffffff 472 t6.Mul(t6, t7) 473 474 // Step 41: t7 = x^0xfffffffe 475 t7.Square(t6) 476 477 // Step 42: t7 = x^0xffffffff 478 t7.Mul(&x, t7) 479 480 // Step 74: t8 = x^0xffffffff00000000 481 t8.Square(t7) 482 for s := 1; s < 32; s++ { 483 t8.Square(t8) 484 } 485 486 // Step 75: t8 = x^0xffffffffffffffff 487 t8.Mul(t7, t8) 488 489 // Step 107: t8 = x^0xffffffffffffffff00000000 490 for s := 0; s < 32; s++ { 491 t8.Square(t8) 492 } 493 494 // Step 108: t7 = x^0xffffffffffffffffffffffff 495 t7.Mul(t7, t8) 496 497 // Step 139: t7 = x^0x7fffffffffffffffffffffff80000000 498 for s := 0; s < 31; s++ { 499 t7.Square(t7) 500 } 501 502 // Step 140: t6 = x^0x7fffffffffffffffffffffffffffffff 503 t6.Mul(t6, t7) 504 505 // Step 145: t6 = x^0xfffffffffffffffffffffffffffffffe0 506 for s := 0; s < 5; s++ { 507 t6.Square(t6) 508 } 509 510 // Step 146: t6 = x^0xfffffffffffffffffffffffffffffffeb 511 t6.Mul(t3, t6) 512 513 // Step 149: t6 = x^0x7fffffffffffffffffffffffffffffff58 514 for s := 0; s < 3; s++ { 515 t6.Square(t6) 516 } 517 518 // Step 150: t6 = x^0x7fffffffffffffffffffffffffffffff5d 519 t6.Mul(z, t6) 520 521 // Step 154: t6 = x^0x7fffffffffffffffffffffffffffffff5d0 522 for s := 0; s < 4; s++ { 523 t6.Square(t6) 524 } 525 526 // Step 155: t6 = x^0x7fffffffffffffffffffffffffffffff5d5 527 t6.Mul(z, t6) 528 529 // Step 159: t6 = x^0x7fffffffffffffffffffffffffffffff5d50 530 for s := 0; s < 4; s++ { 531 t6.Square(t6) 532 } 533 534 // Step 160: t6 = x^0x7fffffffffffffffffffffffffffffff5d57 535 t6.Mul(t5, t6) 536 537 // Step 165: t6 = x^0xfffffffffffffffffffffffffffffffebaae0 538 for s := 0; s < 5; s++ { 539 t6.Square(t6) 540 } 541 542 // Step 166: t6 = x^0xfffffffffffffffffffffffffffffffebaaed 543 t6.Mul(t1, t6) 544 545 // Step 168: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb4 546 for s := 0; s < 2; s++ { 547 t6.Square(t6) 548 } 549 550 // Step 169: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb7 551 t6.Mul(t2, t6) 552 553 // Step 174: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e0 554 for s := 0; s < 5; s++ { 555 t6.Square(t6) 556 } 557 558 // Step 175: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e7 559 t6.Mul(t5, t6) 560 561 // Step 181: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9c0 562 for s := 0; s < 6; s++ { 563 t6.Square(t6) 564 } 565 566 // Step 182: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd 567 t6.Mul(t1, t6) 568 569 // Step 187: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739a0 570 for s := 0; s < 5; s++ { 571 t6.Square(t6) 572 } 573 574 // Step 188: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739ab 575 t6.Mul(t3, t6) 576 577 // Step 192: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739ab0 578 for s := 0; s < 4; s++ { 579 t6.Square(t6) 580 } 581 582 // Step 193: t6 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd 583 t6.Mul(t1, t6) 584 585 // Step 196: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e8 586 for s := 0; s < 3; s++ { 587 t6.Square(t6) 588 } 589 590 // Step 197: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9 591 t6.Mul(&x, t6) 592 593 // Step 203: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a40 594 for s := 0; s < 6; s++ { 595 t6.Square(t6) 596 } 597 598 // Step 204: t6 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a45 599 t6.Mul(z, t6) 600 601 // Step 214: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e91400 602 for s := 0; s < 10; s++ { 603 t6.Square(t6) 604 } 605 606 // Step 215: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e91407 607 t6.Mul(t5, t6) 608 609 // Step 219: t6 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e914070 610 for s := 0; s < 4; s++ { 611 t6.Square(t6) 612 } 613 614 // Step 220: t5 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e914077 615 t5.Mul(t5, t6) 616 617 // Step 229: t5 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280ee00 618 for s := 0; s < 9; s++ { 619 t5.Square(t5) 620 } 621 622 // Step 230: t4 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff 623 t4.Mul(t4, t5) 624 625 // Step 235: t4 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe0 626 for s := 0; s < 5; s++ { 627 t4.Square(t4) 628 } 629 630 // Step 236: t4 = x^0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe9 631 t4.Mul(t0, t4) 632 633 // Step 242: t4 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa40 634 for s := 0; s < 6; s++ { 635 t4.Square(t4) 636 } 637 638 // Step 243: t3 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4b 639 t3.Mul(t3, t4) 640 641 // Step 247: t3 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4b0 642 for s := 0; s < 4; s++ { 643 t3.Square(t3) 644 } 645 646 // Step 248: t3 = x^0x1fffffffffffffffffffffffffffffffd755db9cd5e9140777fa4bd 647 t3.Mul(t1, t3) 648 649 // Step 253: t3 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a0 650 for s := 0; s < 5; s++ { 651 t3.Square(t3) 652 } 653 654 // Step 254: t2 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3 655 t2.Mul(t2, t3) 656 657 // Step 260: t2 = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8c0 658 for s := 0; s < 6; s++ { 659 t2.Square(t2) 660 } 661 662 // Step 261: t2 = x^0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd 663 t2.Mul(t1, t2) 664 665 // Step 271: t2 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a33400 666 for s := 0; s < 10; s++ { 667 t2.Square(t2) 668 } 669 670 // Step 272: t1 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d 671 t1.Mul(t1, t2) 672 673 // Step 276: t1 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d0 674 for s := 0; s < 4; s++ { 675 t1.Square(t1) 676 } 677 678 // Step 277: t0 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d9 679 t0.Mul(t0, t1) 680 681 // Step 285: t0 = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d900 682 for s := 0; s < 8; s++ { 683 t0.Square(t0) 684 } 685 686 // Step 286: z = x^0x3fffffffffffffffffffffffffffffffaeabb739abd2280eeff497a3340d905 687 z.Mul(z, t0) 688 689 // Step 291: z = x^0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0 690 for s := 0; s < 5; s++ { 691 z.Square(z) 692 } 693 694 return z 695 }