Ruby  2.0.0p247(2013-06-27revision41674)
Defines | Functions | Variables
ext/openssl/ossl_digest.c File Reference
#include "ossl.h"

Go to the source code of this file.

Defines

#define GetDigest(obj, ctx)
#define SafeGetDigest(obj, ctx)

Functions

static VALUE ossl_digest_alloc (VALUE klass)
const EVP_MD * GetDigestPtr (VALUE obj)
VALUE ossl_digest_new (const EVP_MD *md)
VALUE ossl_digest_update (VALUE, VALUE)
static VALUE ossl_digest_initialize (int argc, VALUE *argv, VALUE self)
static VALUE ossl_digest_copy (VALUE self, VALUE other)
static VALUE ossl_digest_reset (VALUE self)
static VALUE ossl_digest_finish (int argc, VALUE *argv, VALUE self)
static VALUE ossl_digest_name (VALUE self)
static VALUE ossl_digest_size (VALUE self)
static VALUE ossl_digest_block_length (VALUE self)
void Init_ossl_digest ()

Variables

VALUE cDigest
VALUE eDigestError

Define Documentation

#define GetDigest (   obj,
  ctx 
)
Value:
do { \
    Data_Get_Struct((obj), EVP_MD_CTX, (ctx)); \
    if (!(ctx)) { \
        ossl_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \
    } \
} while (0)

Definition at line 13 of file ossl_digest.c.

Referenced by ossl_digest_block_length(), ossl_digest_copy(), ossl_digest_finish(), ossl_digest_initialize(), ossl_digest_name(), ossl_digest_new(), ossl_digest_reset(), ossl_digest_size(), and ossl_digest_update().

#define SafeGetDigest (   obj,
  ctx 
)
Value:
do { \
    OSSL_Check_Kind((obj), cDigest); \
    GetDigest((obj), (ctx)); \
} while (0)

Definition at line 19 of file ossl_digest.c.

Referenced by GetDigestPtr(), and ossl_digest_copy().


Function Documentation

const EVP_MD* GetDigestPtr ( VALUE  obj)
void Init_ossl_digest ( void  )
static VALUE ossl_digest_alloc ( VALUE  klass) [static]
static VALUE ossl_digest_block_length ( VALUE  self) [static]

Definition at line 284 of file ossl_digest.c.

References GetDigest, and INT2NUM.

Referenced by Init_ossl_digest().

static VALUE ossl_digest_copy ( VALUE  self,
VALUE  other 
) [static]

Definition at line 136 of file ossl_digest.c.

References eDigestError, GetDigest, NULL, ossl_raise(), rb_check_frozen, and SafeGetDigest.

Referenced by Init_ossl_digest().

static VALUE ossl_digest_finish ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_digest_initialize ( int  argc,
VALUE argv,
VALUE  self 
) [static]
static VALUE ossl_digest_name ( VALUE  self) [static]

Definition at line 239 of file ossl_digest.c.

References EVP_MD_name, GetDigest, and rb_str_new2().

Referenced by Init_ossl_digest().

VALUE ossl_digest_new ( const EVP_MD *  md)
static VALUE ossl_digest_reset ( VALUE  self) [static]

Definition at line 161 of file ossl_digest.c.

References eDigestError, EVP_DigestInit_ex, GetDigest, NULL, and ossl_raise().

Referenced by Init_ossl_digest().

static VALUE ossl_digest_size ( VALUE  self) [static]

Definition at line 261 of file ossl_digest.c.

References GetDigest, and INT2NUM.

Referenced by Init_ossl_digest().

VALUE ossl_digest_update ( VALUE  self,
VALUE  data 
)

Definition at line 189 of file ossl_digest.c.

References GetDigest, RSTRING_LEN, RSTRING_PTR, and StringValue.

Referenced by Init_ossl_digest(), and ossl_digest_initialize().


Variable Documentation

Definition at line 27 of file ossl_digest.c.

Referenced by Init_ossl_digest(), and ossl_digest_new().