Skip to content

Commit

Permalink
Formating files with new go1.19 fmt tool.
Browse files Browse the repository at this point in the history
  • Loading branch information
armfazh committed Aug 8, 2022
1 parent 826352f commit 76ec70b
Show file tree
Hide file tree
Showing 73 changed files with 436 additions and 306 deletions.
4 changes: 3 additions & 1 deletion dh/csidh/csidh.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ func GeneratePublicKey(pub *PublicKey, prv *PrivateKey, rng io.Reader) {
// Validate returns true if 'pub' is a valid cSIDH public key,
// otherwise false.
// More precisely, the function verifies that curve
// y^2 = x^3 + pub.a * x^2 + x
//
// y^2 = x^3 + pub.a * x^2 + x
//
// is supersingular.
func Validate(pub *PublicKey, rng io.Reader) bool {
// Check if in range
Expand Down
13 changes: 9 additions & 4 deletions dh/csidh/curve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ package csidh

// xAdd implements differential arithmetic in P^1 for Montgomery
// curves E(x): x^3 + A*x^2 + x by using x-coordinate only arithmetic.
// x(PaQ) = x(P) + x(Q) by using x(P-Q)
//
// x(PaQ) = x(P) + x(Q) by using x(P-Q)
//
// This algorithms is correctly defined only for cases when
// P!=inf, Q!=inf, P!=Q and P!=-Q.
func xAdd(PaQ, P, Q, PdQ *point) {
Expand All @@ -23,7 +25,9 @@ func xAdd(PaQ, P, Q, PdQ *point) {

// xDbl implements point doubling on a Montgomery curve
// E(x): x^3 + A*x^2 + x by using x-coordinate onlyh arithmetic.
// x(Q) = [2]*x(P)
//
// x(Q) = [2]*x(P)
//
// It is correctly defined for all P != inf.
func xDbl(Q, P, A *point) {
var t0, t1, t2 fp
Expand All @@ -45,8 +49,9 @@ func xDbl(Q, P, A *point) {
// xDblAdd implements combined doubling of point P
// and addition of points P and Q on a Montgomery curve
// E(x): x^3 + A*x^2 + x by using x-coordinate onlyh arithmetic.
// x(PaP) = x(2*P)
// x(PaQ) = x(P+Q)
//
// x(PaP) = x(2*P)
// x(PaQ) = x(P+Q)
func xDblAdd(PaP, PaQ, P, Q, PdQ *point, A24 *coeff) {
var t0, t1, t2 fp

Expand Down
5 changes: 2 additions & 3 deletions dh/csidh/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// for securing systems.
//
// References:
// - cSIDH: ia.cr/2018/383
// - Faster cSIDH: ia.cr/2018/782
//
// - cSIDH: ia.cr/2018/383
// - Faster cSIDH: ia.cr/2018/782
package csidh
6 changes: 4 additions & 2 deletions dh/csidh/fp511.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,10 @@ func modExpRdc64(r, b *fp, e uint64) {
// isNonQuadRes checks whether value v is quadratic residue.
// Implementation uses Fermat's little theorem (or
// Euler's criterion)
// a^(p-1) == 1, hence
// (a^2) ((p-1)/2) == 1
//
// a^(p-1) == 1, hence
// (a^2) ((p-1)/2) == 1
//
// Which means v is a quadratic residue iff v^((p-1)/2) == 1.
// Caller provided v must be in montgomery domain.
// Returns 0 in case v is quadratic residue or 1 in case
Expand Down
5 changes: 2 additions & 3 deletions dh/curve4q/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// at the 128-bit security level.
//
// References:
// - https://eprint.iacr.org/2015/565
// - https://tools.ietf.org/html/draft-ladd-cfrg-4q-01
//
// - https://eprint.iacr.org/2015/565
// - https://tools.ietf.org/html/draft-ladd-cfrg-4q-01
package curve4q
9 changes: 4 additions & 5 deletions dh/sidh/doc.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Package sidh is deprecated, it provides SIDH and SIKE key encapsulation
// mechanisms.
//
// DEPRECATION NOTICE
// # DEPRECATION NOTICE
//
// SIDH and SIKE are deprecated as were shown vulnerable to a key recovery
// attack by Castryck-Decru's paper (https://eprint.iacr.org/2022/975). New
// systems should not rely on this package. This package is frozen.
//
// SIDH and SIKE
// # SIDH and SIKE
//
// This package provides implementation of experimental post-quantum
// Supersingular Isogeny Diffie-Hellman (SIDH) as well as Supersingular
Expand Down Expand Up @@ -38,7 +38,6 @@
//
// References:
//
// - [SIDH] https://eprint.iacr.org/2011/506
// - [SIKE] http://www.sike.org/files/SIDH-spec.pdf
//
// - [SIDH] https://eprint.iacr.org/2011/506
// - [SIKE] http://www.sike.org/files/SIDH-spec.pdf
package sidh
9 changes: 9 additions & 0 deletions dh/sidh/internal/p434/arith_decl.go

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

10 changes: 6 additions & 4 deletions dh/sidh/internal/p434/curve.go

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

10 changes: 7 additions & 3 deletions dh/sidh/internal/p434/fp2.go

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

9 changes: 9 additions & 0 deletions dh/sidh/internal/p503/arith_decl.go

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

10 changes: 6 additions & 4 deletions dh/sidh/internal/p503/curve.go

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

10 changes: 7 additions & 3 deletions dh/sidh/internal/p503/fp2.go

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

9 changes: 9 additions & 0 deletions dh/sidh/internal/p751/arith_decl.go

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

10 changes: 6 additions & 4 deletions dh/sidh/internal/p751/curve.go

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

Loading

0 comments on commit 76ec70b

Please sign in to comment.