From 64c52e327a867c3259e9b7f4b75f78556d2b1eb3 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 25 Aug 2017 09:37:05 -0400 Subject: [PATCH] unbreak maybe? --- contrib/backends/srndv2/src/srnd/crypto_nacl.go | 6 +++--- contrib/backends/srndv2/src/srnd/message.go | 4 ++-- contrib/backends/srndv2/src/srnd/util.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/crypto_nacl.go b/contrib/backends/srndv2/src/srnd/crypto_nacl.go index e636feb..a368233 100644 --- a/contrib/backends/srndv2/src/srnd/crypto_nacl.go +++ b/contrib/backends/srndv2/src/srnd/crypto_nacl.go @@ -2,14 +2,14 @@ package srnd import "github.com/majestrate/nacl" -func nacl_cryptoVerifyFucky(hash, sig, pk []byte) bool { +func naclCryptoVerifyFucky(hash, sig, pk []byte) bool { return nacl.CryptoVerifyFucky(hash, sig, pk) } -func nacl_cryptoSignFucky(hash, sk []byte) (sig []byte) { +func naclCryptoSignFucky(hash, sk []byte) (sig []byte) { return nacl.CryptoSignFucky(hash, sk) } -func nacl_cryptoVerifyDetached(hash, sig, pk []byte) bool { +func naclCryptoVerifyDetached(hash, sig, pk []byte) bool { return nacl.CryptoVerifyDetached(hash, sig, pk) } diff --git a/contrib/backends/srndv2/src/srnd/message.go b/contrib/backends/srndv2/src/srnd/message.go index d40b72e..f98388a 100644 --- a/contrib/backends/srndv2/src/srnd/message.go +++ b/contrib/backends/srndv2/src/srnd/message.go @@ -464,7 +464,7 @@ func verifyMessageSHA512(pk, sig string, body *io.LimitedReader, innerHandler fu hash := h.Sum(nil) log.Printf("hash=%s", hexify(hash)) log.Printf("sig=%s", hexify(sig_bytes)) - if nacl_cryptoVerifyFucky(hash, sig_bytes, pk_bytes) { + if naclCryptoVerifyFucky(hash, sig_bytes, pk_bytes) { log.Println("signature is valid :^)") } else { err = errors.New("invalid signature") @@ -502,7 +502,7 @@ func verifyMessageBLAKE2B(pk, sig string, body *io.LimitedReader, innerHandler f hash := h.Sum(nil) log.Printf("hash=%s", hexify(hash)) log.Printf("sig=%s", hexify(sig_bytes)) - if nacl_cryptoVerifyDetached(hash, sig_bytes, pk_bytes) { + if naclCryptoVerifyDetached(hash, sig_bytes, pk_bytes) { log.Println("signature is valid :^)") } else { err = errors.New("invalid signature") diff --git a/contrib/backends/srndv2/src/srnd/util.go b/contrib/backends/srndv2/src/srnd/util.go index 95746e4..2591458 100644 --- a/contrib/backends/srndv2/src/srnd/util.go +++ b/contrib/backends/srndv2/src/srnd/util.go @@ -405,7 +405,7 @@ func getSignPubkey(sk []byte) string { // XXX: DEPRECATED func cryptoSignFucky(h, sk []byte) string { // sign - sig := nacl_cryptoSignFucky(h, sk) + sig := naclCryptoSignFucky(h, sk) if sig == nil { return "[failed to sign]" } @@ -413,7 +413,7 @@ func cryptoSignFucky(h, sk []byte) string { } // convert seed to secret key -func seedToKeyPair(seed []byte) (full ed25519.PrivateKey, pub ed25519.PublicKey) { +func seedToKeyPair(seed []byte) (pub ed25519.PublicKey, full ed25519.PrivateKey) { var in [32]byte var out [32]byte copy(in[:], seed[0:32]) @@ -426,7 +426,7 @@ func seedToKeyPair(seed []byte) (full ed25519.PrivateKey, pub ed25519.PublicKey) func cryptoSignProper(h, sk []byte) string { // convert key - key, _ := seedToKeyPair(sk) + _, key := seedToKeyPair(sk) // sign sig := ed25519.Sign(key, h) if sig == nil { @@ -688,7 +688,7 @@ func verifyFrontendSig(pubkey, sig, msgid string) bool { s := unhex(sig) k := unhex(pubkey) h := sha512.Sum512([]byte(msgid)) - return nacl_cryptoVerifyFucky(h[:], s, k) + return naclCryptoVerifyFucky(h[:], s, k) } func msgidFrontendSign(sk []byte, msgid string) string {