---
name: "libressl-EC_POINT_add"
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_POINT_add"
---

# libressl-EC\_POINT\_add(3)

perform mathematical operations and tests on EC\_POINT objects

## NAME

**EC\_POINT\_add**, **EC\_POINT\_dbl**, **EC\_POINT\_invert**, **EC\_POINT\_is\_at\_infinity**, **EC\_POINT\_is\_on\_curve**, **EC\_POINT\_cmp**, **EC\_POINT\_make\_affine**, **EC\_POINT\_mul** – perform mathematical operations and tests on EC\_POINT objects

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

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

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

*int*\

**EC\_POINT\_add**(*const EC\_GROUP \*group*, *EC\_POINT \*r*, *const EC\_POINT \*a*, *const EC\_POINT \*b*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_dbl**(*const EC\_GROUP \*group*, *EC\_POINT \*r*, *const EC\_POINT \*a*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_invert**(*const EC\_GROUP \*group*, *EC\_POINT \*a*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_is\_at\_infinity**(*const EC\_GROUP \*group*, *const EC\_POINT \*p*);

*int*\

**EC\_POINT\_is\_on\_curve**(*const EC\_GROUP \*group*, *const EC\_POINT \*point*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_cmp**(*const EC\_GROUP \*group*, *const EC\_POINT \*a*, *const EC\_POINT \*b*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_make\_affine**(*const EC\_GROUP \*group*, *EC\_POINT \*point*, *BN\_CTX \*ctx*);

*int*\

**EC\_POINT\_mul**(*const EC\_GROUP \*group*, *EC\_POINT \*r*, *const BIGNUM \*n*, *const EC\_POINT \*q*, *const BIGNUM \*m*, *BN\_CTX \*ctx*);

## DESCRIPTION

These functions operate on *EC\_POINT* objects created by EC\_POINT\_new(3).

**EC\_POINT\_add**() adds the two points *a* and *b* and places the result in *r*. Similarly **EC\_POINT\_dbl**() doubles the point *a* and places the result in *r*. In both cases it is valid for *r* to be one of *a* or *b*.

**EC\_POINT\_invert**() calculates the inverse of the supplied point *a*. The result is placed back in *a*.

The function **EC\_POINT\_is\_at\_infinity**() tests whether the supplied point is at infinity or not.

**EC\_POINT\_is\_on\_curve**() tests whether the supplied point is on the curve or not.

**EC\_POINT\_cmp**() compares the two supplied points and tests whether or not they are equal.

**EC\_POINT\_mul**() calculates the value

generator \* n + q \* m

and stores the result in *r*. The value *n* may be NULL, in which case the result is just

```
q * m.
```

See EC\_GROUP\_new\_curve\_GFp(3) for information about the generator.

## RETURN VALUES

The following functions return 1 on success or 0 on error: **EC\_POINT\_add**(), **EC\_POINT\_dbl**(), **EC\_POINT\_invert**(), **EC\_POINT\_make\_affine**(), and **EC\_POINT\_mul**()

**EC\_POINT\_is\_at\_infinity**() returns 1 if the point is at infinity or 0 otherwise.

**EC\_POINT\_is\_on\_curve**() returns 1 if the point is on the curve, 0 if not, or -1 on error.

**EC\_POINT\_cmp**() returns 1 if the points are not equal, 0 if they are, or -1 on error.

## SEE ALSO

[crypto(3)](/crypto/3.md), d2i\_ECPKParameters(3), EC\_GROUP\_check(3), EC\_GROUP\_get\_curve\_name(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\_get\_affine\_coordinates(3), EC\_POINT\_new(3), EC\_POINT\_point2oct(3)

## HISTORY

**EC\_POINT\_add**(), **EC\_POINT\_dbl**(), **EC\_POINT\_invert**(), **EC\_POINT\_is\_at\_infinity**(), **EC\_POINT\_is\_on\_curve**(), **EC\_POINT\_cmp**(), **EC\_POINT\_make\_affine**(), and **EC\_POINT\_mul**() first appeared in OpenSSL 0.9.7 and have been available since OpenBSD 3.2.
