---
name: "libressl-EC_GROUP_get_curve_name"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-EC_GROUP_get_curve_name"
---

# libressl-EC\_GROUP\_get\_curve\_name(3)

configure and inspect details of the ASN.1 encoding of EC\_GROUP and related objects

## NAME

**EC\_GROUP\_get\_curve\_name**, **EC\_GROUP\_set\_curve\_name**, **EC\_GROUP\_get\_asn1\_flag**, **EC\_GROUP\_set\_asn1\_flag**, **EC\_GROUP\_get0\_seed**, **EC\_GROUP\_get\_seed\_len**, **EC\_GROUP\_set\_seed**, **EC\_GROUP\_get\_point\_conversion\_form**, **EC\_GROUP\_set\_point\_conversion\_form**, **EC\_GROUP\_get\_basis\_type** – configure and inspect details of the ASN.1 encoding of *EC\_GROUP* and related objects

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#include \<openssl/ec.h\>**

*int*\

**EC\_GROUP\_get\_curve\_name**(*const EC\_GROUP \*group*);

*void*\

**EC\_GROUP\_set\_curve\_name**(*EC\_GROUP \*group*, *int nid*);

*int*\

**EC\_GROUP\_get\_asn1\_flag**(*const EC\_GROUP \*group*);

*void*\

**EC\_GROUP\_set\_asn1\_flag**(*EC\_GROUP \*group*, *int flag*);

*unsigned* *char* *\**\

**EC\_GROUP\_get0\_seed**(*const EC\_GROUP \*group*);

*size\_t*\

**EC\_GROUP\_get\_seed\_len**(*const EC\_GROUP \*group*);

*size\_t*\

**EC\_GROUP\_set\_seed**(*EC\_GROUP \*group*, *const unsigned char \*seed*, *size\_t len*);

```
typedef enum {
	POINT_CONVERSION_COMPRESSED = 2,
	POINT_CONVERSION_UNCOMPRESSED = 4,
	POINT_CONVERSION_HYBRID = 6
} point_conversion_form_t;
```

*point\_conversion\_form\_t*\

**EC\_GROUP\_get\_point\_conversion\_form**(*const EC\_GROUP \*group*);

*void*\

**EC\_GROUP\_set\_point\_conversion\_form**(*EC\_GROUP \*group*, *point\_conversion\_form\_t form*);

Deprecated:

*int*\

**EC\_GROUP\_get\_basis\_type**(*const EC\_GROUP \*group*);

## DESCRIPTION

The functions in this manual affect or allow the inspection of the details of the ASN.1 encoding produced by the i2d\_ECPKParameters(3) family of functions. Modern applications use named curves and uncompressed point encoding, which are the default for EC\_GROUP\_new\_by\_curve\_name(3).

In this library, Elliptic curve parameters are either encoded as a *named* *curve*, using an ASN.1 Object Identifier (OID) to refer to standardized parameters that need to be built into the library, or using *explicit* *curve* *parameters* where the field, the curve equation, the base point's coordinates and other data are encoded explicitly. The *implicitly* *CA* variant is not supported.

**EC\_GROUP\_get\_curve\_name**() gets the Numerical Identifier (NID) representation of the ASN.1 Object Identifier used for the named curve encoding of *group*. **EC\_GROUP\_set\_curve\_name**() sets it to *nid*.

**EC\_GROUP\_get\_asn1\_flag**() retrieves the value of the *asn1\_flag* member of *group*. If the bit corresponding to OPENSSL\_EC\_NAMED\_CURVE is set, named curve encoding is used for *group*, otherwise explicit encoding is used. **EC\_GROUP\_set\_asn1\_flag**() sets the *asn1\_flag* member of group to *flag*, which should be either OPENSSL\_EC\_NAMED\_CURVE to use named curve encoding or OPENSSL\_EC\_EXPLICIT\_CURVE to use explicit encoding.

The ASN.1 encoding of explicit curve parameters includes an optional seed value for parameters generated verifiably at random. If a seed value is set on *group*, **EC\_GROUP\_get0\_seed**() returns a pointer to the internal byte string whose length is returned by **EC\_GROUP\_get\_seed\_len**().

**EC\_GROUP\_set\_seed**() first clears any seed and length already stored in *group*. If *seed* is not NULL and *len* is not zero, it stores a copy of them in *group*. The *seed* should be a random byte string of *len* at least 20 bytes. The seed can be unset by passing NULL as a *seed* and a *len* of zero. The library does not perform any computation or validation with this seed, it only includes it in its ASN.1 encoded parameters, whether it contains a sensible value or not.

Points on an elliptic curve, such as the generator or a public key, can be encoded in compressed form, uncompressed form, or in a hybrid form encompassing both, see EC\_POINT\_point2oct(3). **EC\_GROUP\_get\_point\_conversion\_form**() retrieves the encoding used for points on *group* and **EC\_GROUP\_set\_point\_conversion\_form**() sets it to *form*.

The deprecated **EC\_GROUP\_get\_basis\_type**() only makes sense for curves over binary fields. It is provided for compatibility only.

## RETURN VALUES

**EC\_GROUP\_get\_curve\_name**() returns the NID to be used for named curve encoding of *group* or NID\_undef if no NID is set.

**EC\_GROUP\_get\_asn1\_flag**() returns the value most recently set by **EC\_GROUP\_set\_asn1\_flag**() on *group*.

**EC\_GROUP\_get0\_seed**() returns an internal pointer to the *seed* on *group* or NULL if none is set.

**EC\_GROUP\_get\_seed\_len**() returns the byte length of the seed set on *group* or zero if none is set.

**EC\_GROUP\_set\_seed**() returns 0 on memory allocation failure. It returns *len* on success unless *seed* is NULL or *len* is zero, in which case it returns 1.

**EC\_GROUP\_get\_point\_conversion\_form**() returns the point conversion form last set by **EC\_GROUP\_set\_point\_conversion\_form**() on *group*.

**EC\_GROUP\_get\_basis\_type**() always returns NID\_undef.

## SEE ALSO

[crypto(3)](/crypto/3.md), d2i\_ECPKParameters(3), EC\_GROUP\_check(3), EC\_GROUP\_new\_by\_curve\_name(3), EC\_GROUP\_new\_curve\_GFp(3), EC\_KEY\_METHOD\_new(3), EC\_KEY\_new(3), EC\_POINT\_add(3), EC\_POINT\_get\_affine\_coordinates(3), EC\_POINT\_new(3), EC\_POINT\_point2oct(3), ECDH\_compute\_key(3), ECDSA\_SIG\_new(3), OBJ\_obj2nid(3)

## HISTORY

These functions first appeared in OpenSSL 0.9.8 and have been available since OpenBSD 4.5.

## BUGS

Most of the setters cannot report errors and none of them perform proper input validation and accept most of the values passed in. This can result in invalid or nonsensical ASN.1 encoding produced by i2d\_ECPKParameters(3) and related functions.
