File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ package extra25519
7
7
import (
8
8
"crypto/sha512"
9
9
10
- "github.com/agl/ ed25519/edwards25519"
10
+ "github.com/diagprov/golang- ed25519/edwards25519"
11
11
)
12
12
13
13
// PrivateKeyToCurve25519 converts an ed25519 private key into a corresponding
Original file line number Diff line number Diff line change @@ -9,18 +9,23 @@ import (
9
9
"crypto/rand"
10
10
"testing"
11
11
12
- "github.com/agl/ ed25519"
12
+ "github.com/diagprov/golang- ed25519"
13
13
"golang.org/x/crypto/curve25519"
14
14
)
15
15
16
16
func TestCurve25519Conversion (t * testing.T ) {
17
- public , private , _ := ed25519 .GenerateKey (rand .Reader )
17
+ public_orig , private_orig , _ := ed25519 .GenerateKey (rand .Reader )
18
+
19
+ var private [64 ]byte
20
+ var public [32 ]byte
21
+ copy (private [:], private_orig )
22
+ copy (public [:], public_orig )
18
23
19
24
var curve25519Public , curve25519Public2 , curve25519Private [32 ]byte
20
- PrivateKeyToCurve25519 (& curve25519Private , private )
25
+ PrivateKeyToCurve25519 (& curve25519Private , & private )
21
26
curve25519 .ScalarBaseMult (& curve25519Public , & curve25519Private )
22
27
23
- if ! PublicKeyToCurve25519 (& curve25519Public2 , public ) {
28
+ if ! PublicKeyToCurve25519 (& curve25519Public2 , & public ) {
24
29
t .Fatalf ("PublicKeyToCurve25519 failed" )
25
30
}
26
31
You can’t perform that action at this time.
0 commit comments