func (k SecretKey) Precompute(peer saltpack.BoxPublicKey) saltpack.BoxPrecomputedSharedKey {
	var res PrecomputedSharedKey
	box.Precompute((*[32]byte)(&res), (*[32]byte)(peer.ToRawBoxKeyPointer()), (*[32]byte)(&k.sec))
	return res
}
Precompute computes a shared key with the passed public key.
package basic
import (
	"crypto/rand"
	"github.com/keybase/saltpack"
	"golang.org/x/crypto/ed25519"
	"golang.org/x/crypto/nacl/box"
)
type EphemeralKeyCreator struct{}
func (c EphemeralKeyCreator) CreateEphemeralKey() (saltpack.BoxSecretKey, error) {
	return generateBoxKey()
}
type PublicKey struct {
	EphemeralKeyCreator
	saltpack.RawBoxKey
}
type SecretKey struct {
	sec saltpack.RawBoxKey
	pub PublicKey
}
type PrecomputedSharedKey saltpack.RawBoxKey
func (k PublicKey) ToKID() []byte {
	return k.RawBoxKey[:]
}
func (k PublicKey) ToRawBoxKeyPointer() *saltpack.RawBoxKey {
	ret := k.RawBoxKey
	return &ret
}
func (k PublicKey) HideIdentity() bool { return false }
func generateBoxKey() (*SecretKey, error) {
	pub, priv, err := box.GenerateKey(rand.Reader)
	if err != nil {
		return nil, err
	}
	ret := NewSecretKey(pub, priv)
	return &ret, nil
}
var _ saltpack.BoxPublicKey = PublicKey{}
func (k SecretKey) Box(receiver saltpack.BoxPublicKey, nonce saltpack.Nonce, msg []byte) []byte {
	ret := box.Seal([]byte{}, msg, (*[24]byte)(&nonce), (*[32]byte)(receiver.ToRawBoxKeyPointer()), (*[32]byte)(&k.sec))
	return ret
}
func (k SecretKey) Unbox(sender saltpack.BoxPublicKey, nonce saltpack.Nonce, msg []byte) ([]byte, error) {
	ret, ok := box.Open([]byte{}, msg, (*[24]byte)(&nonce), (*[32]byte)(sender.ToRawBoxKeyPointer()), (*[32]byte)(&k.sec))
	if !ok {
		return nil, saltpack.ErrDecryptionFailed
	}
	return ret, nil
}
func (k SecretKey) GetPublicKey() saltpack.BoxPublicKey {
	return k.pub
}