Archived
1
0

add debugging for testing

This commit is contained in:
Jeff Becker 2017-08-25 10:11:23 -04:00
parent dbb5897305
commit 88d723219a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package srnd
import ( import (
"github.com/majestrate/nacl" "github.com/majestrate/nacl"
"golang.org/x/crypto/curve25519"
) )
func naclCryptoVerifyFucky(h, sig, pk []byte) bool { func naclCryptoVerifyFucky(h, sig, pk []byte) bool {
@ -19,3 +20,5 @@ func naclCryptoVerifyDetached(hash, sig, pk []byte) bool {
func naclCryptoSignDetached(hash, sk []byte) []byte { func naclCryptoSignDetached(hash, sk []byte) []byte {
return nacl.CryptoSignDetached(hash, sk) return nacl.CryptoSignDetached(hash, sk)
} }
var naclScalarBaseMult = curve25519.ScalarBaseMult

View File

@ -12,7 +12,6 @@ import (
"encoding/base64" "encoding/base64"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"golang.org/x/crypto/curve25519"
"golang.org/x/crypto/ed25519" "golang.org/x/crypto/ed25519"
"io" "io"
"log" "log"
@ -419,10 +418,11 @@ func seedToKeyPair(seed []byte) (pub ed25519.PublicKey, full ed25519.PrivateKey)
var in [32]byte var in [32]byte
var out [32]byte var out [32]byte
copy(in[:], seed[0:32]) copy(in[:], seed[0:32])
curve25519.ScalarBaseMult(&out, &in) naclScalarBaseMult(&out, &in)
copy(pub[:], out[:]) copy(pub[:], out[:])
copy(full[:], in[:]) copy(full[0:32], in[:])
copy(full[32:], pub[:]) copy(full[32:64], pub[:])
log.Println("pk=", hexify(pub[:]))
return return
} }