Ruby  2.0.0p451(2014-02-24revision45167)
Macros | Functions
sha2init.c File Reference
#include "digest.h"
#include "sha2.h"
Include dependency graph for sha2init.c:

Go to the source code of this file.

Macros

#define FOREACH_BITLEN(func)   func(256) func(384) func(512)
 
#define DEFINE_ALGO_METADATA(bitlen)
 
#define DECLARE_ALGO_CLASS(bitlen)   VALUE cDigest_SHA##bitlen;
 
#define DEFINE_ALGO_CLASS(bitlen)
 

Functions

void Init_sha2 ()
 

Macro Definition Documentation

#define DECLARE_ALGO_CLASS (   bitlen)    VALUE cDigest_SHA##bitlen;

Referenced by Init_sha2().

#define DEFINE_ALGO_CLASS (   bitlen)
Value:
cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \
rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \
Data_Wrap_Struct(rb_cObject, 0, 0, (void *)&sha##bitlen));
VALUE rb_define_class_under(VALUE outer, const char *name, VALUE super)
Defines a class under the namespace of outer.
Definition: class.c:545
VALUE rb_ivar_set(VALUE, ID, VALUE)
Definition: variable.c:1128
static ID id_metadata
Definition: digest.c:24
RUBY_EXTERN VALUE rb_cObject
Definition: ripper.y:1426
#define Data_Wrap_Struct(klass, mark, free, sval)

Referenced by Init_sha2().

#define DEFINE_ALGO_METADATA (   bitlen)
Value:
static const rb_digest_metadata_t sha##bitlen = { \
SHA##bitlen##_DIGEST_LENGTH, \
SHA##bitlen##_BLOCK_LENGTH, \
sizeof(SHA##bitlen##_CTX), \
(rb_digest_hash_init_func_t)SHA##bitlen##_Init, \
(rb_digest_hash_update_func_t)SHA##bitlen##_Update, \
(rb_digest_hash_finish_func_t)SHA##bitlen##_Finish, \
};
#define RUBY_DIGEST_API_VERSION
Definition: digest.h:18
void(* rb_digest_hash_finish_func_t)(void *, unsigned char *)
Definition: digest.h:22
void(* rb_digest_hash_update_func_t)(void *, unsigned char *, size_t)
Definition: digest.h:21
#define sizeof(x)
Definition: zlib.c:58
void(* rb_digest_hash_init_func_t)(void *)
Definition: digest.h:20

Definition at line 13 of file sha2init.c.

#define FOREACH_BITLEN (   func)    func(256) func(384) func(512)

Definition at line 11 of file sha2init.c.

Referenced by Init_sha2().

Function Documentation

void Init_sha2 ( )