Ruby: ext/openssl/ossl_pkey_ec.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions | Variables
ossl_pkey_ec.c File Reference
`#include "ossl.h"`

Go to the source code of this file.

## Macros
#define | EXPORT_PEM 0
#define | EXPORT_DER 1
#define | GetPKeyEC(obj, pkey)
#define | GetEC(obj, key)
#define | GetECGroup(obj, group)
#define | GetECPoint(obj, point)
#define | GetECPointGroup(obj, group)

## Functions
VALUE | ossl_ec_new (EVP_PKEY *pkey)
void | Init_ossl_ec (void)

## Variables
VALUE | cEC
VALUE | eECError
VALUE | cEC_GROUP
VALUE | eEC_GROUP
VALUE | cEC_POINT
VALUE | eEC_POINT

## Macro Definition Documentation

## ◆ EXPORT_DER

#define EXPORT_DER 1

Definition at line 10 of file ossl_pkey_ec.c.

## ◆ EXPORT_PEM

#define EXPORT_PEM 0

Definition at line 9 of file ossl_pkey_ec.c.

## ◆ GetEC

#define GetEC | ( |  | obj,
|  |  | key
| ) |  |

Value:
do { \
EVP_PKEY *_pkey; \
GetPKeyEC(obj, _pkey); \
(key) = EVP_PKEY_get0_EC_KEY(_pkey); \
} while (0)
key
key
Definition: openssl_missing.h:185

Definition at line 21 of file ossl_pkey_ec.c.

## ◆ GetECGroup

#define GetECGroup | ( |  | obj,
|  |  | group
| ) |  |

Value:
do { \
TypedData_Get_Struct(obj, EC_GROUP, &ossl_ec_group_type, group); \
if ((group) == NULL) \
ossl_raise(eEC_GROUP, "EC_GROUP is not initialized"); \
} while (0)
eEC_GROUP
VALUE eEC_GROUP
Definition: ossl_pkey_ec.c:46
NULL
#define NULL
Definition: regenc.h:69

Definition at line 27 of file ossl_pkey_ec.c.

## ◆ GetECPoint

#define GetECPoint | ( |  | obj,
|  |  | point
| ) |  |

Value:
do { \
TypedData_Get_Struct(obj, EC_POINT, &ossl_ec_point_type, point); \
if ((point) == NULL) \
ossl_raise(eEC_POINT, "EC_POINT is not initialized"); \
} while (0)
eEC_POINT
VALUE eEC_POINT
Definition: ossl_pkey_ec.c:48
point
Definition: zran.c:68

Definition at line 33 of file ossl_pkey_ec.c.

## ◆ GetECPointGroup

#define GetECPointGroup | ( |  | obj,
|  |  | group
| ) |  |

Value:
do { \
VALUE _group = rb_attr_get(obj, id_i_group); \
GetECGroup(_group, group); \
} while (0)
rb_attr_get
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1242
VALUE
unsigned long VALUE
Definition: value.h:38

Definition at line 38 of file ossl_pkey_ec.c.

## ◆ GetPKeyEC

#define GetPKeyEC | ( |  | obj,
|  |  | pkey
| ) |  |

Value:
do { \
GetPKey((obj), (pkey)); \
if (EVP_PKEY_base_id(pkey) != EVP_PKEY_EC) { \
ossl_raise(rb_eRuntimeError, "THIS IS NOT A EC PKEY!"); \
} \
} while (0)
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1055

Definition at line 15 of file ossl_pkey_ec.c.

## Function Documentation

## ◆ Init_ossl_ec()

void Init_ossl_ec | ( | void |  | ) |

Definition at line 1678 of file ossl_pkey_ec.c.

References cEC, cEC_GROUP, cEC_POINT, cPKey, eEC_GROUP, eEC_POINT, eECError, eOSSLError, ePKeyError, INT2NUM, mOSSL, mPKey, rb_attr(), rb_cObject, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_const(), rb_define_method, rb_define_module_under(), rb_define_singleton_method, rb_eStandardError, and rb_intern().

Referenced by Init_ossl_pkey().

## ◆ ossl_ec_new()

VALUE ossl_ec_new | ( | EVP_PKEY * | pkey | ) |

Definition at line 87 of file ossl_pkey_ec.c.

References cEC, eECError, NewPKey, NULL, ossl_raise(), Qfalse, rb_eTypeError, and SetPKey.

## Variable Documentation

## ◆ cEC

VALUE cEC

Definition at line 43 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec(), and ossl_ec_new().

## ◆ cEC_GROUP

VALUE cEC_GROUP

Definition at line 45 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec().

## ◆ cEC_POINT

VALUE cEC_POINT

Definition at line 47 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec().

## ◆ eEC_GROUP

VALUE eEC_GROUP

Definition at line 46 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec().

## ◆ eEC_POINT

VALUE eEC_POINT

Definition at line 48 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec().

## ◆ eECError

VALUE eECError

Definition at line 44 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec(), and ossl_ec_new().