libressl-EC_POINT_new3
Allocate, free and copy elliptic curve points
Usage
Crypto Library (libcrypto, -lcrypto)
#include <openssl/ec.h>
EC_POINT *
EC_POINT_new(const EC_GROUP *group);
void
EC_POINT_free(EC_POINT *point);
void
EC_POINT_clear_free(EC_POINT *point);
int
EC_POINT_copy(EC_POINT *dst, const EC_POINT *src);
EC_POINT *
EC_POINT_dup(const EC_POINT *point, const EC_GROUP *group);
Overview
An EC_POINT object holds a point on the elliptic curve represented by an EC_GROUP. The details of the internal representation depend on the group and should never be an application's concern since the EC library has API to set a point's coordinates, EC_POINT_set_affine_coordinates(3).
EC_POINT_new() allocates and initializes an EC_POINT object to be used with the group. Before explicitly setting its coordinates, the returned EC_POINT is invalid.
EC_POINT_free() frees point and all memory associated with it. If point is a NULL pointer, no action occurs.
EC_POINT_clear_free() is intended to destroy sensitive data held in point in addition to freeing all memory associated with it. Since elliptic curve points usually hold public data, this is rarely needed. In LibreSSL, EC_POINT_free() and EC_POINT_clear_free() behave identically.
EC_POINT_copy() copies the internal representation of src into dst. If src and dst are identical, no action occurs. Both src and dst should be the result of EC_POINT_new() with the same group argument, although EC_POINT_copy() cannot check that.
EC_POINT_dup() creates a deep copy of point by combining EC_POINT_new() with EC_GROUP_copy().
Return values
EC_POINT_new() returns a newly allocated EC_POINT or NULL on memory allocation failure.
EC_POINT_copy() returns 1 on success or 0 on error. Error conditions include memory allocation failure and that dst is incompatible with the group on which src is defined.
EC_POINT_dup() returns a newly allocated EC_POINT or NULL on failure. Error conditions include memory allocation failure or that group is incompatible with src.