diff --git a/contrib/backends/srndv2/src/srnd/crypto_test.go b/contrib/backends/srndv2/src/srnd/crypto_test.go index de95bfe..226ec10 100644 --- a/contrib/backends/srndv2/src/srnd/crypto_test.go +++ b/contrib/backends/srndv2/src/srnd/crypto_test.go @@ -24,10 +24,10 @@ func TestSeedToKeypair(t *testing.T) { func TestSign(t *testing.T) { msgid := "" - seed := randbytes(32) - pk, sec := naclSeedToKeyPair(seed) + var seed [32]byte + pk, sec := naclSeedToKeyPair(seed[:]) sig := msgidFrontendSign(sec, msgid) - t.Log(sig) + t.Logf("seed=%s pk=%s sk=%s sig=%s", hexify(seed[:]), hexify(pk), hexify(sec), sig) if !verifyFrontendSig(hexify(pk), sig, msgid) { t.Fail() } diff --git a/contrib/backends/srndv2/src/srnd/cryptography.go b/contrib/backends/srndv2/src/srnd/cryptography.go index 47e0bb4..9581665 100644 --- a/contrib/backends/srndv2/src/srnd/cryptography.go +++ b/contrib/backends/srndv2/src/srnd/cryptography.go @@ -29,8 +29,8 @@ func naclSeedToKeyPair(seed []byte) (pk, sk []byte) { sk[31] |= 64 // scalarmult magick shit pk = scalarBaseMult(sk[0:32]) + copy(sk[0:32], seed[0:32]) copy(sk[32:64], pk[0:32]) - return }