MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / GenECDHSharedSecret

Function GenECDHSharedSecret

crypto/asymmetric/keyexchange.go:27–29  ·  view source on GitHub ↗

GenECDHSharedSecret is just a wrapper of ec.GenerateSharedSecret which generates a shared secret based on a private key and a public key using Diffie-Hellman key exchange (ECDH) (RFC 4753). RFC5903 Section 9 states we should only return x. Key Feature: GenECDHSharedSecret(BPub, APriv) == GenECDHSh

(privateKey *PrivateKey, publicKey *PublicKey)

Source from the content-addressed store, hash-verified

25// Key Feature:
26// GenECDHSharedSecret(BPub, APriv) == GenECDHSharedSecret(APub, BPriv).
27func GenECDHSharedSecret(privateKey *PrivateKey, publicKey *PublicKey) []byte {
28 return ec.GenerateSharedSecret((*ec.PrivateKey)(privateKey), (*ec.PublicKey)(publicKey))
29}

Callers 2

GetSharedSecretWithFunction · 0.92
TestGenECDHSharedSecretFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGenECDHSharedSecretFunction · 0.68