CKey::ComputeBIP324ECDHSecret

Compute a BIP324-style ECDH shared secret.

Synopsis

Declared in <key.h>

ECDHSecret
ComputeBIP324ECDHSecret(
    EllSwiftPubKey const& their_ellswift,
    EllSwiftPubKey const& our_ellswift,
    bool initiating) const;

Description

  • their_ellswift: EllSwiftPubKey that was received from the other side.

  • our_ellswift: EllSwiftPubKey that was sent to the other side (must have been generated from *this using EllSwiftCreate()).

  • initiating: whether we are the initiating party (true) or responding party (false).

Return Value

The derived BIP324 shared secret.

Parameters

NameDescription
their_ellswiftThe ellswift-encoded public key received from the other side.
our_ellswiftThe ellswift-encoded public key sent to the other side.
initiatingWhether we are the initiating party (true) or responding party (false).