ciphering.mx raw

   1  // Copyright (c) 2015-2016 The btcsuite developers
   2  // Use of this source code is governed by an ISC
   3  // license that can be found in the LICENSE file.
   4  
   5  package btcec
   6  
   7  import (
   8  	"smesh.lol/pkg/nostr/ec/secp256k1"
   9  )
  10  
  11  // GenerateSharedSecret generates a shared secret based on a secret key and a
  12  // public key using Diffie-Hellman key exchange (ECDH) (RFC 4753).
  13  // RFC5903 Section 9 states we should only return x.
  14  func GenerateSharedSecret(privkey *SecretKey, pubkey *PublicKey) []byte {
  15  	return secp256k1.GenerateSharedSecret(privkey, pubkey)
  16  }
  17