Skip to content

Commit

Permalink
bls12381: faster e6 MulBy01
Browse files Browse the repository at this point in the history
  • Loading branch information
shramee committed Mar 9, 2024
1 parent 444f06f commit 859ee92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions std/algebra/emulated/fields_bls12381/e6.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ func (e Ext6) MulBy01(z *E6, c0, c1 *E2) *E6 {
t0 = e.Ext2.Sub(t0, b)
t0 = e.Ext2.MulByNonResidue(t0)
t0 = e.Ext2.Add(t0, a)
tmp = e.Ext2.Add(&z.B0, &z.B2)
t2 := e.Ext2.Mul(c0, tmp)
t2 = e.Ext2.Sub(t2, a)
// for t2, schoolbook is faster than karatsuba
// c2 = a0b2 + a1b1 + a2b0,
// c2 = a2b0 + b ∵ b2 = 0, b = a1b1
t2 := e.Ext2.Mul(&z.B2, c0)
t2 = e.Ext2.Add(t2, b)
t1 := e.Ext2.Add(c0, c1)
tmp = e.Ext2.Add(&z.B0, &z.B1)
Expand Down

0 comments on commit 859ee92

Please sign in to comment.