github.com/consensys/gnark-crypto@v0.14.0/ecc/bls24-317/internal/fptower/e2_fallback.go (about)

     1  //go:build !amd64
     2  // +build !amd64
     3  
     4  // Copyright 2020 ConsenSys Software Inc.
     5  //
     6  // Licensed under the Apache License, Version 2.0 (the "License");
     7  // you may not use this file except in compliance with the License.
     8  // You may obtain a copy of the License at
     9  //
    10  //     http://www.apache.org/licenses/LICENSE-2.0
    11  //
    12  // Unless required by applicable law or agreed to in writing, software
    13  // distributed under the License is distributed on an "AS IS" BASIS,
    14  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  // See the License for the specific language governing permissions and
    16  // limitations under the License.
    17  
    18  package fptower
    19  
    20  func addE2(z, x, y *E2) {
    21  	z.A0.Add(&x.A0, &y.A0)
    22  	z.A1.Add(&x.A1, &y.A1)
    23  }
    24  
    25  func subE2(z, x, y *E2) {
    26  	z.A0.Sub(&x.A0, &y.A0)
    27  	z.A1.Sub(&x.A1, &y.A1)
    28  }
    29  
    30  func doubleE2(z, x *E2) {
    31  	z.A0.Double(&x.A0)
    32  	z.A1.Double(&x.A1)
    33  }
    34  
    35  func negE2(z, x *E2) {
    36  	z.A0.Neg(&x.A0)
    37  	z.A1.Neg(&x.A1)
    38  }