]> Cypherpunks.ru repositories - gostls13.git/commitdiff
crypto/ed25519/internal/edwards25519: move to crypto/internal/edwards25519
authorFilippo Valsorda <filippo@golang.org>
Thu, 7 Apr 2022 19:15:31 +0000 (15:15 -0400)
committerFilippo Valsorda <filippo@golang.org>
Thu, 5 May 2022 21:53:10 +0000 (21:53 +0000)
This will allow us to use crypto/internal/edwards25519/field from
crypto/ecdh to implement X25519, dropping the dependency on
golang.org/x/crypto/curve25519.

For #52182

Change-Id: I3be9debc6e13bf06944b98668f34313a975914d0
Reviewed-on: https://go-review.googlesource.com/c/go/+/402556
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>

26 files changed:
src/crypto/ed25519/ed25519.go
src/crypto/internal/edwards25519/doc.go [moved from src/crypto/ed25519/internal/edwards25519/doc.go with 100% similarity]
src/crypto/internal/edwards25519/edwards25519.go [moved from src/crypto/ed25519/internal/edwards25519/edwards25519.go with 97% similarity]
src/crypto/internal/edwards25519/edwards25519_test.go [moved from src/crypto/ed25519/internal/edwards25519/edwards25519_test.go with 99% similarity]
src/crypto/internal/edwards25519/field/_asm/fe_amd64_asm.go [moved from src/crypto/ed25519/internal/edwards25519/field/_asm/fe_amd64_asm.go with 99% similarity]
src/crypto/internal/edwards25519/field/_asm/go.mod [moved from src/crypto/ed25519/internal/edwards25519/field/_asm/go.mod with 100% similarity]
src/crypto/internal/edwards25519/field/_asm/go.sum [moved from src/crypto/ed25519/internal/edwards25519/field/_asm/go.sum with 100% similarity]
src/crypto/internal/edwards25519/field/fe.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_alias_test.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_alias_test.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_amd64.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_amd64.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_amd64.s [moved from src/crypto/ed25519/internal/edwards25519/field/fe_amd64.s with 100% similarity]
src/crypto/internal/edwards25519/field/fe_amd64_noasm.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_amd64_noasm.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_arm64.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_arm64.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_arm64.s [moved from src/crypto/ed25519/internal/edwards25519/field/fe_arm64.s with 100% similarity]
src/crypto/internal/edwards25519/field/fe_arm64_noasm.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_arm64_noasm.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_bench_test.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_bench_test.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_generic.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_generic.go with 100% similarity]
src/crypto/internal/edwards25519/field/fe_test.go [moved from src/crypto/ed25519/internal/edwards25519/field/fe_test.go with 100% similarity]
src/crypto/internal/edwards25519/scalar.go [moved from src/crypto/ed25519/internal/edwards25519/scalar.go with 100% similarity]
src/crypto/internal/edwards25519/scalar_alias_test.go [moved from src/crypto/ed25519/internal/edwards25519/scalar_alias_test.go with 100% similarity]
src/crypto/internal/edwards25519/scalar_test.go [moved from src/crypto/ed25519/internal/edwards25519/scalar_test.go with 100% similarity]
src/crypto/internal/edwards25519/scalarmult.go [moved from src/crypto/ed25519/internal/edwards25519/scalarmult.go with 100% similarity]
src/crypto/internal/edwards25519/scalarmult_test.go [moved from src/crypto/ed25519/internal/edwards25519/scalarmult_test.go with 100% similarity]
src/crypto/internal/edwards25519/tables.go [moved from src/crypto/ed25519/internal/edwards25519/tables.go with 100% similarity]
src/crypto/internal/edwards25519/tables_test.go [moved from src/crypto/ed25519/internal/edwards25519/tables_test.go with 100% similarity]
src/go/build/deps_test.go

index 4669e02db24c544626bd79bae76c9f11cd1e72e5..d43dd12d083dfba6869840085d6641de0faa17ae 100644 (file)
@@ -15,7 +15,7 @@ package ed25519
 import (
        "bytes"
        "crypto"
-       "crypto/ed25519/internal/edwards25519"
+       "crypto/internal/edwards25519"
        cryptorand "crypto/rand"
        "crypto/sha512"
        "errors"
similarity index 97%
rename from src/crypto/ed25519/internal/edwards25519/edwards25519.go
rename to src/crypto/internal/edwards25519/edwards25519.go
index 4e0ad7a357d1182017008b2af353e73bc531123d..71e9c097a954413a0f4d5687c5fb8b093498aea1 100644 (file)
@@ -5,7 +5,7 @@
 package edwards25519
 
 import (
-       "crypto/ed25519/internal/edwards25519/field"
+       "crypto/internal/edwards25519/field"
        "errors"
 )
 
@@ -147,9 +147,8 @@ func (v *Point) SetBytes(x []byte) (*Point, error) {
        //      (*field.Element).SetBytes docs) and
        //   2) the ones where the x-coordinate is zero and the sign bit is set.
        //
-       // This is consistent with crypto/ed25519/internal/edwards25519. Read more
-       // at https://hdevalence.ca/blog/2020-10-04-its-25519am, specifically the
-       // "Canonical A, R" section.
+       // Read more at https://hdevalence.ca/blog/2020-10-04-its-25519am,
+       // specifically the "Canonical A, R" section.
 
        y, err := new(field.Element).SetBytes(x)
        if err != nil {
similarity index 99%
rename from src/crypto/ed25519/internal/edwards25519/edwards25519_test.go
rename to src/crypto/internal/edwards25519/edwards25519_test.go
index 8031256525a53487fcadfbcfee4f971abe9611d0..9bc33f9017617f3af0ecb6ed607bd4fa124d8e1d 100644 (file)
@@ -5,7 +5,7 @@
 package edwards25519
 
 import (
-       "crypto/ed25519/internal/edwards25519/field"
+       "crypto/internal/edwards25519/field"
        "encoding/hex"
        "os"
        "reflect"
similarity index 99%
rename from src/crypto/ed25519/internal/edwards25519/field/_asm/fe_amd64_asm.go
rename to src/crypto/internal/edwards25519/field/_asm/fe_amd64_asm.go
index fbc0cce22c726e1bdbf4a6ed16c04c8af33e826d..411399cb1e83d392f8030915cb30d3d90bad2ef1 100644 (file)
@@ -16,7 +16,7 @@ import (
 //go:generate go run . -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field
 
 func main() {
-       Package("crypto/ed25519/internal/edwards25519/field")
+       Package("crypto/internal/edwards25519/field")
        ConstraintExpr("amd64,gc,!purego")
        feMul()
        feSquare()
index f6d41dd28fd729212d10d436b891d783c018ee9d..5b971b93e20803a2eaf90a2c293a9d56437b16a0 100644 (file)
@@ -408,8 +408,8 @@ var depsRules = `
        < crypto/internal/subtle
        < crypto/internal/nistec/fiat
        < crypto/internal/nistec
-       < crypto/ed25519/internal/edwards25519/field, golang.org/x/crypto/curve25519/internal/field
-       < crypto/ed25519/internal/edwards25519
+       < crypto/internal/edwards25519/field, golang.org/x/crypto/curve25519/internal/field
+       < crypto/internal/edwards25519
        < crypto/cipher
        < crypto/internal/boring
        < crypto/boring