Skip to content

Commit

Permalink
Reorder Fp2Mul
Browse files Browse the repository at this point in the history
  • Loading branch information
armfazh committed Aug 26, 2022
1 parent e98f6ff commit 0968f6a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dh/sidh/internal/p434/fp2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dh/sidh/internal/p503/fp2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dh/sidh/internal/p751/fp2.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dh/sidh/internal/templates/fp2.gotemp
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ func mul(dest, lhs, rhs *common.Fp2) {
// (b - a)*(c - d) = (b*c + a*d) - a*c - b*d
//
// so (a*d + b*c) = (b-a)*(c-d) + a*c + b*d.
mul{{.FIELD}}(&ac, &lhs.A, &rhs.A) // = a*c*R*R
mul{{.FIELD}}(&bd, &lhs.B, &rhs.B) // = b*d*R*R
sub{{.FIELD}}(&bMinA, &lhs.B, &lhs.A) // = (b-a)*R
sub{{.FIELD}}(&cMinD, &rhs.A, &rhs.B) // = (c-d)*R
mul{{.FIELD}}(&ac, &lhs.A, &rhs.A) // = a*c*R*R
mul{{.FIELD}}(&bd, &lhs.B, &rhs.B) // = b*d*R*R
mul{{.FIELD}}(&adPlusBc, &bMinA, &cMinD) // = (b-a)*(c-d)*R*R
adl{{.FIELD}}(&adPlusBc, &adPlusBc, &ac) // = ((b-a)*(c-d) + a*c)*R*R
adl{{.FIELD}}(&adPlusBc, &adPlusBc, &bd) // = ((b-a)*(c-d) + a*c + b*d)*R*R
Expand Down

0 comments on commit 0968f6a

Please sign in to comment.