Ruby  3.1.0dev(2021-09-10revisionb76ad15ed0da636161de0243c547ee1e6fc95681)
Macros | Functions | Variables
ossl_pkey_ec.c File Reference

(b76ad15ed0da636161de0243c547ee1e6fc95681)

#include "ossl.h"
Include dependency graph for ossl_pkey_ec.c:

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

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)

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)

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)

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)

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)

Definition at line 15 of file ossl_pkey_ec.c.

Function Documentation

◆ Init_ossl_ec()

void Init_ossl_ec ( void  )

Variable Documentation

◆ cEC

VALUE cEC

Definition at line 43 of file ossl_pkey_ec.c.

Referenced by Init_ossl_ec().

◆ 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().

eEC_POINT
VALUE eEC_POINT
Definition: ossl_pkey_ec.c:48
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:1091
NULL
#define NULL
Definition: regenc.h:69
rb_attr_get
VALUE rb_attr_get(VALUE, ID)
Definition: variable.c:1245
key
key
Definition: openssl_missing.h:145
eEC_GROUP
VALUE eEC_GROUP
Definition: ossl_pkey_ec.c:46