github.com/consensys/gnark-crypto@v0.14.0/ecc/bn254/internal/fptower/e2_amd64.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 fptower
    18  
    19  //go:noescape
    20  func addE2(res, x, y *E2)
    21  
    22  //go:noescape
    23  func subE2(res, x, y *E2)
    24  
    25  //go:noescape
    26  func doubleE2(res, x *E2)
    27  
    28  //go:noescape
    29  func negE2(res, x *E2)
    30  
    31  //go:noescape
    32  func mulNonResE2(res, x *E2)
    33  
    34  //go:noescape
    35  func squareAdxE2(res, x *E2)
    36  
    37  //go:noescape
    38  func mulAdxE2(res, x, y *E2)
    39  
    40  // MulByNonResidue multiplies a E2 by (9,1)
    41  func (z *E2) MulByNonResidue(x *E2) *E2 {
    42  	mulNonResE2(z, x)
    43  	return z
    44  }
    45  
    46  // Mul sets z to the E2-product of x,y, returns z
    47  func (z *E2) Mul(x, y *E2) *E2 {
    48  	mulAdxE2(z, x, y)
    49  	return z
    50  }
    51  
    52  // Square sets z to the E2-product of x,x, returns z
    53  func (z *E2) Square(x *E2) *E2 {
    54  	squareAdxE2(z, x)
    55  	return z
    56  }