Ejemplo n.º 1
0
// Calculate the stealth difference
func StealthPub(pub, priv []byte) (res []byte) {
	res = make([]byte, 33)
	if secp256k1.Multiply(pub, priv, res) {
	} else {
		res = nil
	}
	return
}
Ejemplo n.º 2
0
// Calculate the stealth difference
func StealthDH(pub, priv []byte) []byte {
	var res [33]byte

	if !secp256k1.Multiply(pub, priv, res[:]) {
		return nil
	}

	s := sha256.New()
	s.Write([]byte{0x03})
	s.Write(res[:])
	return s.Sum(nil)
}