EC_GROUP_new_curve_GFp function
EC_GROUP_new_curve_GFp creates a new, arbitrary elliptic curve group based on the equation y² = x³ + a·x + b. It returns the new group or NULL on error. The lifetime of the resulting object must be managed with |EC_GROUP_dup| and |EC_GROUP_free|.
This new group has no generator. It is an error to use a generator-less group with any functions except for |EC_GROUP_free|, |EC_POINT_new|, |EC_POINT_set_affine_coordinates_GFp|, and |EC_GROUP_set_generator|.
|EC_GROUP|s returned by this function will always compare as unequal via |EC_GROUP_cmp| (even to themselves). |EC_GROUP_get_curve_name| will always return |NID_undef|.
This function is provided for compatibility with some legacy applications only. Avoid using arbitrary curves and use |EC_GROUP_new_by_curve_name| instead. This ensures the result meets preconditions necessary for elliptic curve algorithms to function correctly and securely.
Given invalid parameters, this function may fail or it may return an |EC_GROUP| which breaks these preconditions. Subsequent operations may then return arbitrary, incorrect values. Callers should not pass attacker-controlled values to this function.
Implementation
@meta.RecordUse()
@ffi.Native<
ffi.Pointer<EC_GROUP> Function(
ffi.Pointer<BIGNUM>,
ffi.Pointer<BIGNUM>,
ffi.Pointer<BIGNUM>,
ffi.Pointer<BN_CTX>,
)
>(symbol: 'bssl_dart_EC_GROUP_new_curve_GFp')
external ffi.Pointer<EC_GROUP> EC_GROUP_new_curve_GFp(
ffi.Pointer<BIGNUM> p,
ffi.Pointer<BIGNUM> a,
ffi.Pointer<BIGNUM> b,
ffi.Pointer<BN_CTX> ctx,
);