github.com/consensys/gnark-crypto@v0.14.0/ecc/bls24-315/internal/fptower/e2_bls315_fallback.go (about) 1 //go:build !amd64 2 // +build !amd64 3 4 // Copyright 2021 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 import "github.com/consensys/gnark-crypto/ecc/bls24-315/fp" 21 22 // Mul sets z to the E2-product of x,y, returns z 23 func (z *E2) Mul(x, y *E2) *E2 { 24 mulGenericE2(z, x, y) 25 return z 26 } 27 28 // MulByNonResidue multiplies a E2 by (0,1) 29 func (z *E2) MulByNonResidue(x *E2) *E2 { 30 z.A0, z.A1 = x.A1, x.A0 31 fp.MulBy13(&z.A0) 32 return z 33 }