1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:50:05 -07:00

crypto/ed25519/internal/edwards25519: move to crypto/internal/edwards25519

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>
This commit is contained in:
Filippo Valsorda 2022-04-07 15:15:31 -04:00
parent 52de40120d
commit 7c74b0db8a
26 changed files with 8 additions and 9 deletions

View File

@ -15,7 +15,7 @@ package ed25519
import (
"bytes"
"crypto"
"crypto/ed25519/internal/edwards25519"
"crypto/internal/edwards25519"
cryptorand "crypto/rand"
"crypto/sha512"
"errors"

View 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 {

View File

@ -5,7 +5,7 @@
package edwards25519
import (
"crypto/ed25519/internal/edwards25519/field"
"crypto/internal/edwards25519/field"
"encoding/hex"
"os"
"reflect"

View 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()

View 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