Ruby 2.7.0p0(2019-12-25revision647ee6f091eafcce70ffb75ddf7e121e192ab217)

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)

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)

Definition at line 23 of file ossl_cipher.c.

## ◆ 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 |  | ) |

Definition at line 821 of file ossl_cipher.c.

References cCipher, eCipherError, eOSSLError, mOSSL, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_module(), and rb_eStandardError.

## ◆ 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 | ) |

Definition at line 52 of file ossl_cipher.c.

References cCipher, GetCipher, obj, ossl_raise(), PRIsVALUE, rb_eArgError, rb_obj_is_kind_of(), RSTRING_PTR, and StringValueCStr.

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

NULL
#define NULL
Definition: _sdbm.c:101
obj
const VALUE VALUE obj
Definition: rb_mjit_min_header-2.7.0.h:5742
rb_eRuntimeError
VALUE rb_eRuntimeError
Definition: error.c:920