github.com/consensys/gnark-crypto@v0.14.0/ecc/bw6-761/internal/fptower/frobenius.go (about) 1 // Copyright 2020 ConsenSys AG 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 package fptower 16 17 import ( 18 "github.com/consensys/gnark-crypto/ecc/bw6-761/fp" 19 ) 20 21 var _frobA = fp.Element{ 22 9193734820520314185, 23 15390913228415833887, 24 5309822015742495676, 25 5431732283202763350, 26 17252325881282386417, 27 298854800984767943, 28 15252629665615712253, 29 11476276919959978448, 30 6617989123466214626, 31 293279592164056124, 32 3271178847573361778, 33 76563709148138387, 34 } 35 var _frobB = fp.Element{ 36 7467050525960156664, 37 11327349735975181567, 38 4886471689715601876, 39 825788856423438757, 40 532349992164519008, 41 5190235139112556877, 42 10134108925459365126, 43 2188880696701890397, 44 14832254987849135908, 45 2933451070611009188, 46 11385631952165834796, 47 64130670718986244, 48 } 49 var _frobC = fp.Element{ 50 10159193990637832851, 51 5286779382647858051, 52 15149190582698529379, 53 10172307932521123666, 54 7672315572788794062, 55 4504265454330324035, 56 8586997380578354686, 57 5916374020980521403, 58 9559933215456904989, 59 10407926721244239843, 60 3712625600415690514, 61 17752318063289862, 62 } 63 var _frobAC = fp.Element{ 64 17481284903592032950, 65 10104133845767975835, 66 8607375506753517913, 67 13706168424391191299, 68 9580010308493592354, 69 14241333420363995524, 70 6665632285037357566, 71 5559902898979457045, 72 15504799981718861253, 73 8332096944629367896, 74 18005297320867222879, 75 58811391084848524, 76 } 77 var _frobBC = fp.Element{ 78 8432509696077675330, 79 1223215890207205731, 80 14725840256671635579, 81 5566364505741799073, 82 9399083757380478269, 83 9395645792458112968, 84 3468476640422007559, 85 15075721871431984968, 86 17774199079839826270, 87 13048098199691192907, 88 11827078705008163532, 89 5319279634137719, 90 } 91 92 // Frobenius set z in E6 to Frobenius(x), return z 93 func (z *E6) Frobenius(x *E6) *E6 { 94 95 z.B0.A0 = x.B0.A0 96 z.B0.A1.Mul(&x.B0.A1, &_frobA) 97 z.B0.A2.Mul(&x.B0.A2, &_frobB) 98 99 z.B1.A0.Mul(&x.B1.A0, &_frobC) 100 z.B1.A1.Mul(&x.B1.A1, &_frobAC) 101 z.B1.A2.Mul(&x.B1.A2, &_frobBC) 102 103 return z 104 }