github.com/consensys/gnark-crypto@v0.14.0/ecc/bls24-317/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, 221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873d7)
    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  	//	_100      = 2*_10
    27  	//	_101      = 1 + _100
    28  	//	_110      = 1 + _101
    29  	//	_111      = 1 + _110
    30  	//	_1001     = _10 + _111
    31  	//	_1011     = _10 + _1001
    32  	//	_1101     = _10 + _1011
    33  	//	_1111     = _10 + _1101
    34  	//	_10001    = _10 + _1111
    35  	//	_10111    = _110 + _10001
    36  	//	_11001    = _10 + _10111
    37  	//	_11011    = _10 + _11001
    38  	//	_110110   = 2*_11011
    39  	//	_111111   = _1001 + _110110
    40  	//	_1111110  = 2*_111111
    41  	//	_1111111  = 1 + _1111110
    42  	//	_10001000 = _1001 + _1111111
    43  	//	i42       = ((_10001000 << 8 + _1111111) << 7 + _10001) << 7
    44  	//	i55       = ((_111111 + i42) << 4 + _101) << 6 + _1101
    45  	//	i74       = ((i55 << 8 + _11011) << 2 + 1) << 7
    46  	//	i87       = ((_111111 + i74) << 8 + _1011) << 2 + 1
    47  	//	i113      = ((i87 << 8 + _1011) << 8 + _1001) << 8
    48  	//	i129      = ((_1111111 + i113) << 5 + _101) << 8 + _11011
    49  	//	i151      = ((i129 << 9 + _1111) << 6 + _1101) << 5
    50  	//	i166      = ((_1001 + i151) << 7 + _10001) << 5 + _11001
    51  	//	i184      = ((i166 << 3 + _101) << 7 + _1111) << 6
    52  	//	i198      = ((_1111 + i184) << 7 + _10001) << 4 + _1001
    53  	//	i219      = ((i198 << 5 + _1101) << 7 + _111111) << 7
    54  	//	return      ((_111 + i219) << 6 + _1111) << 6 + _10111
    55  	//
    56  	// Operations: 190 squares 44 multiplies
    57  
    58  	// Allocate Temporaries.
    59  	var (
    60  		t0  = new(Element)
    61  		t1  = new(Element)
    62  		t2  = new(Element)
    63  		t3  = new(Element)
    64  		t4  = new(Element)
    65  		t5  = new(Element)
    66  		t6  = new(Element)
    67  		t7  = new(Element)
    68  		t8  = new(Element)
    69  		t9  = new(Element)
    70  		t10 = new(Element)
    71  		t11 = new(Element)
    72  	)
    73  
    74  	// var t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11 Element
    75  	// Step 1: t2 = x^0x2
    76  	t2.Square(&x)
    77  
    78  	// Step 2: z = x^0x4
    79  	z.Square(t2)
    80  
    81  	// Step 3: t6 = x^0x5
    82  	t6.Mul(&x, z)
    83  
    84  	// Step 4: z = x^0x6
    85  	z.Mul(&x, t6)
    86  
    87  	// Step 5: t1 = x^0x7
    88  	t1.Mul(&x, z)
    89  
    90  	// Step 6: t4 = x^0x9
    91  	t4.Mul(t2, t1)
    92  
    93  	// Step 7: t10 = x^0xb
    94  	t10.Mul(t2, t4)
    95  
    96  	// Step 8: t3 = x^0xd
    97  	t3.Mul(t2, t10)
    98  
    99  	// Step 9: t0 = x^0xf
   100  	t0.Mul(t2, t3)
   101  
   102  	// Step 10: t5 = x^0x11
   103  	t5.Mul(t2, t0)
   104  
   105  	// Step 11: z = x^0x17
   106  	z.Mul(z, t5)
   107  
   108  	// Step 12: t7 = x^0x19
   109  	t7.Mul(t2, z)
   110  
   111  	// Step 13: t8 = x^0x1b
   112  	t8.Mul(t2, t7)
   113  
   114  	// Step 14: t2 = x^0x36
   115  	t2.Square(t8)
   116  
   117  	// Step 15: t2 = x^0x3f
   118  	t2.Mul(t4, t2)
   119  
   120  	// Step 16: t9 = x^0x7e
   121  	t9.Square(t2)
   122  
   123  	// Step 17: t9 = x^0x7f
   124  	t9.Mul(&x, t9)
   125  
   126  	// Step 18: t11 = x^0x88
   127  	t11.Mul(t4, t9)
   128  
   129  	// Step 26: t11 = x^0x8800
   130  	for s := 0; s < 8; s++ {
   131  		t11.Square(t11)
   132  	}
   133  
   134  	// Step 27: t11 = x^0x887f
   135  	t11.Mul(t9, t11)
   136  
   137  	// Step 34: t11 = x^0x443f80
   138  	for s := 0; s < 7; s++ {
   139  		t11.Square(t11)
   140  	}
   141  
   142  	// Step 35: t11 = x^0x443f91
   143  	t11.Mul(t5, t11)
   144  
   145  	// Step 42: t11 = x^0x221fc880
   146  	for s := 0; s < 7; s++ {
   147  		t11.Square(t11)
   148  	}
   149  
   150  	// Step 43: t11 = x^0x221fc8bf
   151  	t11.Mul(t2, t11)
   152  
   153  	// Step 47: t11 = x^0x221fc8bf0
   154  	for s := 0; s < 4; s++ {
   155  		t11.Square(t11)
   156  	}
   157  
   158  	// Step 48: t11 = x^0x221fc8bf5
   159  	t11.Mul(t6, t11)
   160  
   161  	// Step 54: t11 = x^0x887f22fd40
   162  	for s := 0; s < 6; s++ {
   163  		t11.Square(t11)
   164  	}
   165  
   166  	// Step 55: t11 = x^0x887f22fd4d
   167  	t11.Mul(t3, t11)
   168  
   169  	// Step 63: t11 = x^0x887f22fd4d00
   170  	for s := 0; s < 8; s++ {
   171  		t11.Square(t11)
   172  	}
   173  
   174  	// Step 64: t11 = x^0x887f22fd4d1b
   175  	t11.Mul(t8, t11)
   176  
   177  	// Step 66: t11 = x^0x221fc8bf5346c
   178  	for s := 0; s < 2; s++ {
   179  		t11.Square(t11)
   180  	}
   181  
   182  	// Step 67: t11 = x^0x221fc8bf5346d
   183  	t11.Mul(&x, t11)
   184  
   185  	// Step 74: t11 = x^0x110fe45fa9a3680
   186  	for s := 0; s < 7; s++ {
   187  		t11.Square(t11)
   188  	}
   189  
   190  	// Step 75: t11 = x^0x110fe45fa9a36bf
   191  	t11.Mul(t2, t11)
   192  
   193  	// Step 83: t11 = x^0x110fe45fa9a36bf00
   194  	for s := 0; s < 8; s++ {
   195  		t11.Square(t11)
   196  	}
   197  
   198  	// Step 84: t11 = x^0x110fe45fa9a36bf0b
   199  	t11.Mul(t10, t11)
   200  
   201  	// Step 86: t11 = x^0x443f917ea68dafc2c
   202  	for s := 0; s < 2; s++ {
   203  		t11.Square(t11)
   204  	}
   205  
   206  	// Step 87: t11 = x^0x443f917ea68dafc2d
   207  	t11.Mul(&x, t11)
   208  
   209  	// Step 95: t11 = x^0x443f917ea68dafc2d00
   210  	for s := 0; s < 8; s++ {
   211  		t11.Square(t11)
   212  	}
   213  
   214  	// Step 96: t10 = x^0x443f917ea68dafc2d0b
   215  	t10.Mul(t10, t11)
   216  
   217  	// Step 104: t10 = x^0x443f917ea68dafc2d0b00
   218  	for s := 0; s < 8; s++ {
   219  		t10.Square(t10)
   220  	}
   221  
   222  	// Step 105: t10 = x^0x443f917ea68dafc2d0b09
   223  	t10.Mul(t4, t10)
   224  
   225  	// Step 113: t10 = x^0x443f917ea68dafc2d0b0900
   226  	for s := 0; s < 8; s++ {
   227  		t10.Square(t10)
   228  	}
   229  
   230  	// Step 114: t9 = x^0x443f917ea68dafc2d0b097f
   231  	t9.Mul(t9, t10)
   232  
   233  	// Step 119: t9 = x^0x887f22fd4d1b5f85a1612fe0
   234  	for s := 0; s < 5; s++ {
   235  		t9.Square(t9)
   236  	}
   237  
   238  	// Step 120: t9 = x^0x887f22fd4d1b5f85a1612fe5
   239  	t9.Mul(t6, t9)
   240  
   241  	// Step 128: t9 = x^0x887f22fd4d1b5f85a1612fe500
   242  	for s := 0; s < 8; s++ {
   243  		t9.Square(t9)
   244  	}
   245  
   246  	// Step 129: t8 = x^0x887f22fd4d1b5f85a1612fe51b
   247  	t8.Mul(t8, t9)
   248  
   249  	// Step 138: t8 = x^0x110fe45fa9a36bf0b42c25fca3600
   250  	for s := 0; s < 9; s++ {
   251  		t8.Square(t8)
   252  	}
   253  
   254  	// Step 139: t8 = x^0x110fe45fa9a36bf0b42c25fca360f
   255  	t8.Mul(t0, t8)
   256  
   257  	// Step 145: t8 = x^0x443f917ea68dafc2d0b097f28d83c0
   258  	for s := 0; s < 6; s++ {
   259  		t8.Square(t8)
   260  	}
   261  
   262  	// Step 146: t8 = x^0x443f917ea68dafc2d0b097f28d83cd
   263  	t8.Mul(t3, t8)
   264  
   265  	// Step 151: t8 = x^0x887f22fd4d1b5f85a1612fe51b079a0
   266  	for s := 0; s < 5; s++ {
   267  		t8.Square(t8)
   268  	}
   269  
   270  	// Step 152: t8 = x^0x887f22fd4d1b5f85a1612fe51b079a9
   271  	t8.Mul(t4, t8)
   272  
   273  	// Step 159: t8 = x^0x443f917ea68dafc2d0b097f28d83cd480
   274  	for s := 0; s < 7; s++ {
   275  		t8.Square(t8)
   276  	}
   277  
   278  	// Step 160: t8 = x^0x443f917ea68dafc2d0b097f28d83cd491
   279  	t8.Mul(t5, t8)
   280  
   281  	// Step 165: t8 = x^0x887f22fd4d1b5f85a1612fe51b079a9220
   282  	for s := 0; s < 5; s++ {
   283  		t8.Square(t8)
   284  	}
   285  
   286  	// Step 166: t7 = x^0x887f22fd4d1b5f85a1612fe51b079a9239
   287  	t7.Mul(t7, t8)
   288  
   289  	// Step 169: t7 = x^0x443f917ea68dafc2d0b097f28d83cd491c8
   290  	for s := 0; s < 3; s++ {
   291  		t7.Square(t7)
   292  	}
   293  
   294  	// Step 170: t6 = x^0x443f917ea68dafc2d0b097f28d83cd491cd
   295  	t6.Mul(t6, t7)
   296  
   297  	// Step 177: t6 = x^0x221fc8bf5346d7e168584bf946c1e6a48e680
   298  	for s := 0; s < 7; s++ {
   299  		t6.Square(t6)
   300  	}
   301  
   302  	// Step 178: t6 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f
   303  	t6.Mul(t0, t6)
   304  
   305  	// Step 184: t6 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3c0
   306  	for s := 0; s < 6; s++ {
   307  		t6.Square(t6)
   308  	}
   309  
   310  	// Step 185: t6 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf
   311  	t6.Mul(t0, t6)
   312  
   313  	// Step 192: t6 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e780
   314  	for s := 0; s < 7; s++ {
   315  		t6.Square(t6)
   316  	}
   317  
   318  	// Step 193: t5 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e791
   319  	t5.Mul(t5, t6)
   320  
   321  	// Step 197: t5 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e7910
   322  	for s := 0; s < 4; s++ {
   323  		t5.Square(t5)
   324  	}
   325  
   326  	// Step 198: t4 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e7919
   327  	t4.Mul(t4, t5)
   328  
   329  	// Step 203: t4 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf2320
   330  	for s := 0; s < 5; s++ {
   331  		t4.Square(t4)
   332  	}
   333  
   334  	// Step 204: t3 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf232d
   335  	t3.Mul(t3, t4)
   336  
   337  	// Step 211: t3 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e7919680
   338  	for s := 0; s < 7; s++ {
   339  		t3.Square(t3)
   340  	}
   341  
   342  	// Step 212: t2 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e79196bf
   343  	t2.Mul(t2, t3)
   344  
   345  	// Step 219: t2 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f80
   346  	for s := 0; s < 7; s++ {
   347  		t2.Square(t2)
   348  	}
   349  
   350  	// Step 220: t1 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f87
   351  	t1.Mul(t1, t2)
   352  
   353  	// Step 226: t1 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf232d7e1c0
   354  	for s := 0; s < 6; s++ {
   355  		t1.Square(t1)
   356  	}
   357  
   358  	// Step 227: t0 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf232d7e1cf
   359  	t0.Mul(t0, t1)
   360  
   361  	// Step 233: t0 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873c0
   362  	for s := 0; s < 6; s++ {
   363  		t0.Square(t0)
   364  	}
   365  
   366  	// Step 234: z = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873d7
   367  	z.Mul(z, t0)
   368  
   369  	return z
   370  }
   371  
   372  // expByLegendreExp is equivalent to z.Exp(x, 221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873d7800000000000000)
   373  //
   374  // uses github.com/mmcloughlin/addchain v0.4.0 to generate a shorter addition chain
   375  func (z *Element) expByLegendreExp(x Element) *Element {
   376  	// addition chain:
   377  	//
   378  	//	_10       = 2*1
   379  	//	_11       = 1 + _10
   380  	//	_101      = _10 + _11
   381  	//	_110      = 1 + _101
   382  	//	_1001     = _11 + _110
   383  	//	_1010     = 1 + _1001
   384  	//	_1011     = 1 + _1010
   385  	//	_1111     = _101 + _1010
   386  	//	_10001    = _10 + _1111
   387  	//	_11011    = _1010 + _10001
   388  	//	_11101    = _10 + _11011
   389  	//	_100011   = _110 + _11101
   390  	//	_101001   = _110 + _100011
   391  	//	_101101   = _1010 + _100011
   392  	//	_101111   = _10 + _101101
   393  	//	_110101   = _110 + _101111
   394  	//	_111001   = _1010 + _101111
   395  	//	_111111   = _110 + _111001
   396  	//	_1111110  = 2*_111111
   397  	//	_1111111  = 1 + _1111110
   398  	//	_10001000 = _1001 + _1111111
   399  	//	i45       = ((_10001000 << 8 + _1111111) << 7 + _10001) << 7
   400  	//	i58       = ((_111111 + i45) << 7 + _101001) << 3 + _101
   401  	//	i77       = ((i58 << 8 + _11011) << 7 + _101111) << 2
   402  	//	i98       = ((_11 + i77) << 10 + _101101) << 8 + _1011
   403  	//	i121      = ((i98 << 8 + _1001) << 8 + _1111111) << 5
   404  	//	i141      = ((_101 + i121) << 8 + _11011) << 9 + _1111
   405  	//	i166      = ((i141 << 8 + _110101) << 6 + _1001) << 9
   406  	//	i179      = ((_111001 + i166) << 3 + _101) << 7 + _1111
   407  	//	i203      = ((i179 << 6 + _1111) << 8 + _100011) << 8
   408  	//	i223      = ((_101101 + i203) << 7 + _111111) << 10 + _111001
   409  	//	return      ((i223 << 5 + _11101) << 5 + _1111) << 59
   410  	//
   411  	// Operations: 248 squares 46 multiplies
   412  
   413  	// Allocate Temporaries.
   414  	var (
   415  		t0  = new(Element)
   416  		t1  = new(Element)
   417  		t2  = new(Element)
   418  		t3  = new(Element)
   419  		t4  = new(Element)
   420  		t5  = new(Element)
   421  		t6  = new(Element)
   422  		t7  = new(Element)
   423  		t8  = new(Element)
   424  		t9  = new(Element)
   425  		t10 = new(Element)
   426  		t11 = new(Element)
   427  		t12 = new(Element)
   428  		t13 = new(Element)
   429  		t14 = new(Element)
   430  		t15 = new(Element)
   431  	)
   432  
   433  	// var t0,t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15 Element
   434  	// Step 1: t7 = x^0x2
   435  	t7.Square(&x)
   436  
   437  	// Step 2: t11 = x^0x3
   438  	t11.Mul(&x, t7)
   439  
   440  	// Step 3: t5 = x^0x5
   441  	t5.Mul(t7, t11)
   442  
   443  	// Step 4: t2 = x^0x6
   444  	t2.Mul(&x, t5)
   445  
   446  	// Step 5: t6 = x^0x9
   447  	t6.Mul(t11, t2)
   448  
   449  	// Step 6: t1 = x^0xa
   450  	t1.Mul(&x, t6)
   451  
   452  	// Step 7: t10 = x^0xb
   453  	t10.Mul(&x, t1)
   454  
   455  	// Step 8: z = x^0xf
   456  	z.Mul(t5, t1)
   457  
   458  	// Step 9: t14 = x^0x11
   459  	t14.Mul(t7, z)
   460  
   461  	// Step 10: t8 = x^0x1b
   462  	t8.Mul(t1, t14)
   463  
   464  	// Step 11: t0 = x^0x1d
   465  	t0.Mul(t7, t8)
   466  
   467  	// Step 12: t4 = x^0x23
   468  	t4.Mul(t2, t0)
   469  
   470  	// Step 13: t13 = x^0x29
   471  	t13.Mul(t2, t4)
   472  
   473  	// Step 14: t3 = x^0x2d
   474  	t3.Mul(t1, t4)
   475  
   476  	// Step 15: t12 = x^0x2f
   477  	t12.Mul(t7, t3)
   478  
   479  	// Step 16: t7 = x^0x35
   480  	t7.Mul(t2, t12)
   481  
   482  	// Step 17: t1 = x^0x39
   483  	t1.Mul(t1, t12)
   484  
   485  	// Step 18: t2 = x^0x3f
   486  	t2.Mul(t2, t1)
   487  
   488  	// Step 19: t9 = x^0x7e
   489  	t9.Square(t2)
   490  
   491  	// Step 20: t9 = x^0x7f
   492  	t9.Mul(&x, t9)
   493  
   494  	// Step 21: t15 = x^0x88
   495  	t15.Mul(t6, t9)
   496  
   497  	// Step 29: t15 = x^0x8800
   498  	for s := 0; s < 8; s++ {
   499  		t15.Square(t15)
   500  	}
   501  
   502  	// Step 30: t15 = x^0x887f
   503  	t15.Mul(t9, t15)
   504  
   505  	// Step 37: t15 = x^0x443f80
   506  	for s := 0; s < 7; s++ {
   507  		t15.Square(t15)
   508  	}
   509  
   510  	// Step 38: t14 = x^0x443f91
   511  	t14.Mul(t14, t15)
   512  
   513  	// Step 45: t14 = x^0x221fc880
   514  	for s := 0; s < 7; s++ {
   515  		t14.Square(t14)
   516  	}
   517  
   518  	// Step 46: t14 = x^0x221fc8bf
   519  	t14.Mul(t2, t14)
   520  
   521  	// Step 53: t14 = x^0x110fe45f80
   522  	for s := 0; s < 7; s++ {
   523  		t14.Square(t14)
   524  	}
   525  
   526  	// Step 54: t13 = x^0x110fe45fa9
   527  	t13.Mul(t13, t14)
   528  
   529  	// Step 57: t13 = x^0x887f22fd48
   530  	for s := 0; s < 3; s++ {
   531  		t13.Square(t13)
   532  	}
   533  
   534  	// Step 58: t13 = x^0x887f22fd4d
   535  	t13.Mul(t5, t13)
   536  
   537  	// Step 66: t13 = x^0x887f22fd4d00
   538  	for s := 0; s < 8; s++ {
   539  		t13.Square(t13)
   540  	}
   541  
   542  	// Step 67: t13 = x^0x887f22fd4d1b
   543  	t13.Mul(t8, t13)
   544  
   545  	// Step 74: t13 = x^0x443f917ea68d80
   546  	for s := 0; s < 7; s++ {
   547  		t13.Square(t13)
   548  	}
   549  
   550  	// Step 75: t12 = x^0x443f917ea68daf
   551  	t12.Mul(t12, t13)
   552  
   553  	// Step 77: t12 = x^0x110fe45fa9a36bc
   554  	for s := 0; s < 2; s++ {
   555  		t12.Square(t12)
   556  	}
   557  
   558  	// Step 78: t11 = x^0x110fe45fa9a36bf
   559  	t11.Mul(t11, t12)
   560  
   561  	// Step 88: t11 = x^0x443f917ea68dafc00
   562  	for s := 0; s < 10; s++ {
   563  		t11.Square(t11)
   564  	}
   565  
   566  	// Step 89: t11 = x^0x443f917ea68dafc2d
   567  	t11.Mul(t3, t11)
   568  
   569  	// Step 97: t11 = x^0x443f917ea68dafc2d00
   570  	for s := 0; s < 8; s++ {
   571  		t11.Square(t11)
   572  	}
   573  
   574  	// Step 98: t10 = x^0x443f917ea68dafc2d0b
   575  	t10.Mul(t10, t11)
   576  
   577  	// Step 106: t10 = x^0x443f917ea68dafc2d0b00
   578  	for s := 0; s < 8; s++ {
   579  		t10.Square(t10)
   580  	}
   581  
   582  	// Step 107: t10 = x^0x443f917ea68dafc2d0b09
   583  	t10.Mul(t6, t10)
   584  
   585  	// Step 115: t10 = x^0x443f917ea68dafc2d0b0900
   586  	for s := 0; s < 8; s++ {
   587  		t10.Square(t10)
   588  	}
   589  
   590  	// Step 116: t9 = x^0x443f917ea68dafc2d0b097f
   591  	t9.Mul(t9, t10)
   592  
   593  	// Step 121: t9 = x^0x887f22fd4d1b5f85a1612fe0
   594  	for s := 0; s < 5; s++ {
   595  		t9.Square(t9)
   596  	}
   597  
   598  	// Step 122: t9 = x^0x887f22fd4d1b5f85a1612fe5
   599  	t9.Mul(t5, t9)
   600  
   601  	// Step 130: t9 = x^0x887f22fd4d1b5f85a1612fe500
   602  	for s := 0; s < 8; s++ {
   603  		t9.Square(t9)
   604  	}
   605  
   606  	// Step 131: t8 = x^0x887f22fd4d1b5f85a1612fe51b
   607  	t8.Mul(t8, t9)
   608  
   609  	// Step 140: t8 = x^0x110fe45fa9a36bf0b42c25fca3600
   610  	for s := 0; s < 9; s++ {
   611  		t8.Square(t8)
   612  	}
   613  
   614  	// Step 141: t8 = x^0x110fe45fa9a36bf0b42c25fca360f
   615  	t8.Mul(z, t8)
   616  
   617  	// Step 149: t8 = x^0x110fe45fa9a36bf0b42c25fca360f00
   618  	for s := 0; s < 8; s++ {
   619  		t8.Square(t8)
   620  	}
   621  
   622  	// Step 150: t7 = x^0x110fe45fa9a36bf0b42c25fca360f35
   623  	t7.Mul(t7, t8)
   624  
   625  	// Step 156: t7 = x^0x443f917ea68dafc2d0b097f28d83cd40
   626  	for s := 0; s < 6; s++ {
   627  		t7.Square(t7)
   628  	}
   629  
   630  	// Step 157: t6 = x^0x443f917ea68dafc2d0b097f28d83cd49
   631  	t6.Mul(t6, t7)
   632  
   633  	// Step 166: t6 = x^0x887f22fd4d1b5f85a1612fe51b079a9200
   634  	for s := 0; s < 9; s++ {
   635  		t6.Square(t6)
   636  	}
   637  
   638  	// Step 167: t6 = x^0x887f22fd4d1b5f85a1612fe51b079a9239
   639  	t6.Mul(t1, t6)
   640  
   641  	// Step 170: t6 = x^0x443f917ea68dafc2d0b097f28d83cd491c8
   642  	for s := 0; s < 3; s++ {
   643  		t6.Square(t6)
   644  	}
   645  
   646  	// Step 171: t5 = x^0x443f917ea68dafc2d0b097f28d83cd491cd
   647  	t5.Mul(t5, t6)
   648  
   649  	// Step 178: t5 = x^0x221fc8bf5346d7e168584bf946c1e6a48e680
   650  	for s := 0; s < 7; s++ {
   651  		t5.Square(t5)
   652  	}
   653  
   654  	// Step 179: t5 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f
   655  	t5.Mul(z, t5)
   656  
   657  	// Step 185: t5 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3c0
   658  	for s := 0; s < 6; s++ {
   659  		t5.Square(t5)
   660  	}
   661  
   662  	// Step 186: t5 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf
   663  	t5.Mul(z, t5)
   664  
   665  	// Step 194: t5 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf00
   666  	for s := 0; s < 8; s++ {
   667  		t5.Square(t5)
   668  	}
   669  
   670  	// Step 195: t4 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf23
   671  	t4.Mul(t4, t5)
   672  
   673  	// Step 203: t4 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf2300
   674  	for s := 0; s < 8; s++ {
   675  		t4.Square(t4)
   676  	}
   677  
   678  	// Step 204: t3 = x^0x887f22fd4d1b5f85a1612fe51b079a9239a3cf232d
   679  	t3.Mul(t3, t4)
   680  
   681  	// Step 211: t3 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e7919680
   682  	for s := 0; s < 7; s++ {
   683  		t3.Square(t3)
   684  	}
   685  
   686  	// Step 212: t2 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e79196bf
   687  	t2.Mul(t2, t3)
   688  
   689  	// Step 222: t2 = x^0x110fe45fa9a36bf0b42c25fca360f352473479e465afc00
   690  	for s := 0; s < 10; s++ {
   691  		t2.Square(t2)
   692  	}
   693  
   694  	// Step 223: t1 = x^0x110fe45fa9a36bf0b42c25fca360f352473479e465afc39
   695  	t1.Mul(t1, t2)
   696  
   697  	// Step 228: t1 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f8720
   698  	for s := 0; s < 5; s++ {
   699  		t1.Square(t1)
   700  	}
   701  
   702  	// Step 229: t0 = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873d
   703  	t0.Mul(t0, t1)
   704  
   705  	// Step 234: t0 = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e79196bf0e7a0
   706  	for s := 0; s < 5; s++ {
   707  		t0.Square(t0)
   708  	}
   709  
   710  	// Step 235: z = x^0x443f917ea68dafc2d0b097f28d83cd491cd1e79196bf0e7af
   711  	z.Mul(z, t0)
   712  
   713  	// Step 294: z = x^0x221fc8bf5346d7e168584bf946c1e6a48e68f3c8cb5f873d7800000000000000
   714  	for s := 0; s < 59; s++ {
   715  		z.Square(z)
   716  	}
   717  
   718  	return z
   719  }