Archived
1
0

works OMG YESH

This commit is contained in:
Jeff Becker 2017-08-26 12:33:13 -04:00
parent f2d854d88f
commit f4a6988f11
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
2 changed files with 4 additions and 4 deletions

View File

@ -24,10 +24,10 @@ func TestSeedToKeypair(t *testing.T) {
func TestSign(t *testing.T) { func TestSign(t *testing.T) {
msgid := "<wut@wut.wut>" msgid := "<wut@wut.wut>"
seed := randbytes(32) var seed [32]byte
pk, sec := naclSeedToKeyPair(seed) pk, sec := naclSeedToKeyPair(seed[:])
sig := msgidFrontendSign(sec, msgid) 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) { if !verifyFrontendSig(hexify(pk), sig, msgid) {
t.Fail() t.Fail()
} }

View File

@ -29,8 +29,8 @@ func naclSeedToKeyPair(seed []byte) (pk, sk []byte) {
sk[31] |= 64 sk[31] |= 64
// scalarmult magick shit // scalarmult magick shit
pk = scalarBaseMult(sk[0:32]) pk = scalarBaseMult(sk[0:32])
copy(sk[0:32], seed[0:32])
copy(sk[32:64], pk[0:32]) copy(sk[32:64], pk[0:32])
return return
} }