Commit 2d8f3c8b authored by Yawning Angel's avatar Yawning Angel
Browse files

common: Replace the extra25519 import with an internal package

I really didn't want to do this, but this should make `go get` work
again, and maybe people will leave me alone.
parent c357dd56
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
Changes in version 0.0.12 - UNRELEASED:
 - Replace the extra25519 import with an internal package.

Changes in version 0.0.11 - 2019-06-21:
 - Update my e-mail address.
+5 −4
Original line number Diff line number Diff line
@@ -43,10 +43,11 @@ import (
	"fmt"
	"io"

	"github.com/agl/ed25519/extra25519"
	"gitlab.com/yawning/obfs4.git/common/csrand"
	"golang.org/x/crypto/curve25519"
	"golang.org/x/crypto/hkdf"

	"gitlab.com/yawning/obfs4.git/common/csrand"
	"gitlab.com/yawning/obfs4.git/internal/extra25519"
)

const (
@@ -203,7 +204,7 @@ func (repr *Representative) Bytes() *[RepresentativeLength]byte {
func (repr *Representative) ToPublic() *PublicKey {
	pub := new(PublicKey)

	extra25519.RepresentativeToPublicKey(pub.Bytes(), repr.Bytes())
	extra25519.UnsafeBrokenRepresentativeToPublicKey(pub.Bytes(), repr.Bytes())
	return pub
}

@@ -275,7 +276,7 @@ func NewKeypair(elligator bool) (*Keypair, error) {

		if elligator {
			// Apply the Elligator transform.  This fails ~50% of the time.
			if !extra25519.ScalarBaseMult(keypair.public.Bytes(),
			if !extra25519.UnsafeBrokenScalarBaseMult(keypair.public.Bytes(),
				keypair.representative.Bytes(),
				keypair.private.Bytes()) {
				continue
+2 −1
Original line number Diff line number Diff line
@@ -2,9 +2,10 @@ module gitlab.com/yawning/obfs4.git

require (
	git.torproject.org/pluggable-transports/goptlib.git v1.0.0
	github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412
	github.com/dchest/siphash v1.2.1
	gitlab.com/yawning/utls.git v0.0.11-1
	golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
	golang.org/x/net v0.0.0-20190328230028-74de082e2cca
)

go 1.13
+0 −2
+21 −0
Original line number Diff line number Diff line
This includes a copy of the edwards25519 and extra25519 packages authored
by agl, that formerly lived at github.com/agl/ed25519 as of the commit
5312a61534124124185d41f09206b9fef1d88403 with the following changes:

 * Import paths fixed up.

 * The unused Ed25519->X25519 key conversion routines were removed.

 * `UnsafeBroken` was prefixed to the routines that are known to be
   severely flawed.

The only reason this is being done (despite agl's wishes that the code
base dies, which I wanted to respect) is so people stop bothering me
about it.

Do not ask me questions about this.
Do not use it in other projects.
Do not use it in anything new.
Do not expect me to maintain this beyond ensuring it continues to build.

All I want is to be left alone.
Loading