func (fucky *fuckyNacl) Sign() (s Signature) { h := fucky.hash.Sum(nil) if h == nil { panic("f**k.hash.Sum == nil") } kp := nacl.LoadSignKey(fucky.k) defer kp.Free() sk := kp.Secret() sig := nacl.CryptoSignFucky(h, sk) if sig == nil { panic("fucky signer's call to nacl.CryptoSignFucky returned nil") } s = Signature(sig) fucky.resetState() return }
// get the public component given the secret key func ToPublic(sk []byte) (pk []byte) { kp := nacl.LoadSignKey(sk) defer kp.Free() pk = kp.Public() return }