From cc5d94ee5f64203311f39e8bf924d551489627f8 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 25 Aug 2017 10:37:46 -0400 Subject: [PATCH] try reverting to old key derivation function --- contrib/backends/srndv2/src/srnd/nacl_crypto.go | 7 +++++++ contrib/backends/srndv2/src/srnd/util.go | 2 ++ 2 files changed, 9 insertions(+) diff --git a/contrib/backends/srndv2/src/srnd/nacl_crypto.go b/contrib/backends/srndv2/src/srnd/nacl_crypto.go index f90ddb4..96462e4 100644 --- a/contrib/backends/srndv2/src/srnd/nacl_crypto.go +++ b/contrib/backends/srndv2/src/srnd/nacl_crypto.go @@ -21,4 +21,11 @@ func naclCryptoSignDetached(hash, sk []byte) []byte { return nacl.CryptoSignDetached(hash, sk) } +func seedToKeyPair(seed []byte) (pk, sk []byte) { + kp := nacl.LoadSignKey(seed) + defer kp.Free() + pk, sk = kp.Public(), kp.Secret() + return +} + var naclScalarBaseMult = curve25519.ScalarBaseMult diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index 5d43a87..4b85190 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -411,6 +411,7 @@ func cryptoSignFucky(h, sk []byte) string { return hexify(sig) } +/* // convert seed to secret key func seedToKeyPair(seed []byte) (pub ed25519.PublicKey, full ed25519.PrivateKey) { pub = make(ed25519.PublicKey, ed25519.PublicKeySize) @@ -430,6 +431,7 @@ func seedToKeyPair(seed []byte) (pub ed25519.PublicKey, full ed25519.PrivateKey) log.Println("pk=", hexify(pub[:])) return } +*/ func cryptoSignProper(h, sk []byte) string { // convert key