Skip to content

Commit

Permalink
bls12377: faster e6 MulBy01
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Mar 9, 2024
1 parent 4eff191 commit 1818bce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions std/algebra/native/fields_bls12377/e6.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ func (e *E6) MulBy01(api frontend.API, c0, c1 E2) *E6 {
t0.MulByNonResidue(api, t0)
t0.Add(api, t0, a)

tmp.Add(api, e.B0, e.B2)
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.B2, c0)
t2.Add(api, t2, b)

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

0 comments on commit 1818bce

Please sign in to comment.