Skip to content

Commit 0968f6a

Browse files
committed
Reorder Fp2Mul
1 parent e98f6ff commit 0968f6a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

dh/sidh/internal/p434/fp2.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dh/sidh/internal/p503/fp2.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dh/sidh/internal/p751/fp2.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dh/sidh/internal/templates/fp2.gotemp

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ func mul(dest, lhs, rhs *common.Fp2) {
7979
// (b - a)*(c - d) = (b*c + a*d) - a*c - b*d
8080
//
8181
// so (a*d + b*c) = (b-a)*(c-d) + a*c + b*d.
82-
mul{{.FIELD}}(&ac, &lhs.A, &rhs.A) // = a*c*R*R
83-
mul{{.FIELD}}(&bd, &lhs.B, &rhs.B) // = b*d*R*R
8482
sub{{.FIELD}}(&bMinA, &lhs.B, &lhs.A) // = (b-a)*R
8583
sub{{.FIELD}}(&cMinD, &rhs.A, &rhs.B) // = (c-d)*R
84+
mul{{.FIELD}}(&ac, &lhs.A, &rhs.A) // = a*c*R*R
85+
mul{{.FIELD}}(&bd, &lhs.B, &rhs.B) // = b*d*R*R
8686
mul{{.FIELD}}(&adPlusBc, &bMinA, &cMinD) // = (b-a)*(c-d)*R*R
8787
adl{{.FIELD}}(&adPlusBc, &adPlusBc, &ac) // = ((b-a)*(c-d) + a*c)*R*R
8888
adl{{.FIELD}}(&adPlusBc, &adPlusBc, &bd) // = ((b-a)*(c-d) + a*c + b*d)*R*R

0 commit comments

Comments
 (0)