std1.0.0-beta-7 SafeC docs

std :: crypto::ec

Function std::ecdh_shared

#include <std/crypto/ec.h> source ยท definition

int ecdh_shared(
    int curve,
    []const unsigned char priv,
    []const unsigned char peer,
    []unsigned char out,
)

ECDH: out (ec_scalar_size bytes) = the x coordinate of priv * peer. 0 if the peer point is invalid or the result is the point at infinity.