Skip to content

Commit

Permalink
bls24315: faster e12 MulBy01
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Mar 9, 2024
1 parent 1ba12f6 commit 39cfb22
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions std/algebra/native/fields_bls24315/e12.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ func (e *E12) MulBy01(api frontend.API, c0, c1 E4) *E12 {
t0.MulByNonResidue(api, t0)
t0.Add(api, t0, a)

tmp.Add(api, e.C0, e.C2)
t2.Mul(api, c0, tmp)
t2.Sub(api, t2, a)
// for t2, schoolbook is faster than karatsuba
// c2 = a0b2 + a1b1 + a2b0,
// c2 = a2b0 + b ∵ b2 = 0, b = a1b1
t2.Mul(api, e.C2, c0)
t2.Add(api, t2, b)

t1.Add(api, c0, c1)
Expand Down

0 comments on commit 39cfb22

Please sign in to comment.