Browse Source

Consolidate the x25519 stuff living under ext/ to a single package.

Yawning Angel 4 years ago
parent
commit
374790b515

+ 3 - 3
crypto/identity/identity.go

@@ -27,7 +27,7 @@ import (
 
 	"git.schwanenlied.me/yawning/basket2.git/crypto"
 	"git.schwanenlied.me/yawning/basket2.git/crypto/rand"
-	"git.schwanenlied.me/yawning/basket2.git/ext/extra25519"
+	"git.schwanenlied.me/yawning/basket2.git/ext/x25519"
 
 	"golang.org/x/crypto/curve25519"
 	"golang.org/x/crypto/ed25519"
@@ -107,7 +107,7 @@ func (k *PrivateKey) ToPEM() []byte {
 }
 
 func (k *PrivateKey) toCurve25519() error {
-	extra25519.PrivateKeyToCurve25519(&k.KEXPrivateKey, k.DSAPrivateKey)
+	x25519.PrivateKeyToCurve25519(&k.KEXPrivateKey, k.DSAPrivateKey)
 	return k.PublicKey.toCurve25519()
 }
 
@@ -189,7 +189,7 @@ func (k *PublicKey) Verify(message []byte, sig []byte) bool {
 }
 
 func (k *PublicKey) toCurve25519() error {
-	extra25519.PublicKeyToCurve25519(&k.KEXPublicKey, k.DSAPublicKey)
+	x25519.PublicKeyToCurve25519(&k.KEXPublicKey, k.DSAPublicKey)
 	if !crypto.MemIsZero(k.KEXPublicKey[:]) {
 		return nil
 	}

+ 0 - 0
ext/elligator2/edwards25519/const.go → ext/x25519/edwards25519/const.go


+ 0 - 0
ext/elligator2/edwards25519/edwards25519.go → ext/x25519/edwards25519/edwards25519.go


+ 1 - 1
ext/elligator2/elligator2.go → ext/x25519/elligator2/elligator2.go

@@ -38,7 +38,7 @@ import (
 	"errors"
 	"io"
 
-	"git.schwanenlied.me/yawning/basket2.git/ext/elligator2/edwards25519"
+	"git.schwanenlied.me/yawning/basket2.git/ext/x25519/edwards25519"
 
 	"golang.org/x/crypto/sha3"
 )

+ 0 - 0
ext/elligator2/elligator2_test.go → ext/x25519/elligator2/elligator2_test.go


+ 2 - 2
ext/extra25519/extra25519.go → ext/x25519/extra25519.go

@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package extra25519
+package x25519
 
 import (
 	"crypto/sha512"
 
-	"git.schwanenlied.me/yawning/basket2.git/ext/elligator2/edwards25519"
+	"git.schwanenlied.me/yawning/basket2.git/ext/x25519/edwards25519"
 )
 
 // PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding

+ 1 - 1
ext/extra25519/extra25519_test.go → ext/x25519/extra25519_test.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package extra25519
+package x25519
 
 import (
 	"bytes"

+ 1 - 1
handshake/obfuscation.go

@@ -26,7 +26,7 @@ import (
 
 	"git.schwanenlied.me/yawning/basket2.git/crypto"
 	"git.schwanenlied.me/yawning/basket2.git/crypto/identity"
-	"git.schwanenlied.me/yawning/basket2.git/ext/elligator2"
+	"git.schwanenlied.me/yawning/basket2.git/ext/x25519/elligator2"
 	"git.schwanenlied.me/yawning/basket2.git/framing"
 	"git.schwanenlied.me/yawning/basket2.git/framing/tentp"