Ruby  2.5.0dev(2017-10-22revision60238)
Macros | Functions | Variables
ossl_cipher.c File Reference
#include "ossl.h"

Go to the source code of this file.

Macros

#define NewCipher(klass)   TypedData_Wrap_Struct((klass), &ossl_cipher_type, 0)
 
#define AllocCipher(obj, ctx)
 
#define GetCipherInit(obj, ctx)
 
#define GetCipher(obj, ctx)
 

Functions

const EVP_CIPHER * ossl_evp_get_cipherbyname (VALUE obj)
 
VALUE ossl_cipher_new (const EVP_CIPHER *cipher)
 
void Init_ossl_cipher (void)
 

Variables

VALUE cCipher
 
VALUE eCipherError
 

Macro Definition Documentation

◆ AllocCipher

#define AllocCipher (   obj,
  ctx 
)
Value:
do { \
(ctx) = EVP_CIPHER_CTX_new(); \
if (!(ctx)) \
ossl_raise(rb_eRuntimeError, NULL); \
RTYPEDDATA_DATA(obj) = (ctx); \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:800
#define NULL
Definition: _sdbm.c:102

Definition at line 14 of file ossl_cipher.c.

◆ GetCipher

#define GetCipher (   obj,
  ctx 
)
Value:
do { \
GetCipherInit((obj), (ctx)); \
if (!(ctx)) { \
ossl_raise(rb_eRuntimeError, "Cipher not initialized!"); \
} \
} while (0)
VALUE rb_eRuntimeError
Definition: error.c:800

Definition at line 23 of file ossl_cipher.c.

Referenced by ossl_evp_get_cipherbyname().

◆ GetCipherInit

#define GetCipherInit (   obj,
  ctx 
)
Value:
do { \
TypedData_Get_Struct((obj), EVP_CIPHER_CTX, &ossl_cipher_type, (ctx)); \
} while (0)

Definition at line 20 of file ossl_cipher.c.

◆ NewCipher

#define NewCipher (   klass)    TypedData_Wrap_Struct((klass), &ossl_cipher_type, 0)

Definition at line 12 of file ossl_cipher.c.

Function Documentation

◆ Init_ossl_cipher()

void Init_ossl_cipher ( void  )

◆ ossl_cipher_new()

VALUE ossl_cipher_new ( const EVP_CIPHER *  cipher)

Definition at line 75 of file ossl_cipher.c.

◆ ossl_evp_get_cipherbyname()

const EVP_CIPHER* ossl_evp_get_cipherbyname ( VALUE  obj)

Variable Documentation

◆ cCipher

VALUE cCipher

Definition at line 33 of file ossl_cipher.c.

Referenced by Init_ossl_cipher(), and ossl_evp_get_cipherbyname().

◆ eCipherError

VALUE eCipherError

Definition at line 34 of file ossl_cipher.c.

Referenced by Init_ossl_cipher().