works OMG YESH
This commit is contained in:
parent
f2d854d88f
commit
f4a6988f11
@ -24,10 +24,10 @@ func TestSeedToKeypair(t *testing.T) {
|
||||
func TestSign(t *testing.T) {
|
||||
|
||||
msgid := "<wut@wut.wut>"
|
||||
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()
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user