Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Functions | Variables
digest.c File Reference
`#include "digest.h"`
Include dependency graph for digest.c:

Go to the source code of this file.

## Functions
RUBY_EXTERN void | Init_digest_base (void)
static VALUE | hexencode_str_new (VALUE str_digest)
static VALUE | rb_digest_s_hexencode (VALUE klass, VALUE str)
| NORETURN (static void rb_digest_instance_method_unimpl(VALUE self, const char *method))
static void | rb_digest_instance_method_unimpl (VALUE self, const char *method)
static VALUE | rb_digest_instance_update (VALUE self, VALUE str)
static VALUE | rb_digest_instance_finish (VALUE self)
static VALUE | rb_digest_instance_reset (VALUE self)
static VALUE | rb_digest_instance_new (VALUE self)
static VALUE | rb_digest_instance_digest (int argc, VALUE *argv, VALUE self)
static VALUE | rb_digest_instance_digest_bang (VALUE self)
static VALUE | rb_digest_instance_hexdigest (int argc, VALUE *argv, VALUE self)
static VALUE | rb_digest_instance_hexdigest_bang (VALUE self)
static VALUE | rb_digest_instance_to_s (VALUE self)
static VALUE | rb_digest_instance_inspect (VALUE self)
static VALUE | rb_digest_instance_equal (VALUE self, VALUE other)
static VALUE | rb_digest_instance_digest_length (VALUE self)
static VALUE | rb_digest_instance_length (VALUE self)
static VALUE | rb_digest_instance_block_length (VALUE self)
static VALUE | rb_digest_class_s_digest (int argc, VALUE *argv, VALUE klass)
static VALUE | rb_digest_class_s_hexdigest (int argc, VALUE *argv, VALUE klass)
static VALUE | rb_digest_class_init (VALUE self)
static rb_digest_metadata_t * | get_digest_base_metadata (VALUE klass)
static VALUE | rb_digest_base_alloc (VALUE klass)
static VALUE | rb_digest_base_copy (VALUE copy, VALUE obj)
static VALUE | rb_digest_base_reset (VALUE self)
static VALUE | rb_digest_base_update (VALUE self, VALUE str)
static VALUE | rb_digest_base_finish (VALUE self)
static VALUE | rb_digest_base_digest_length (VALUE self)
static VALUE | rb_digest_base_block_length (VALUE self)
void | Init_digest (void)

## Variables
static VALUE | rb_mDigest
static VALUE | rb_mDigest_Instance
static VALUE | rb_cDigest_Class
static VALUE | rb_cDigest_Base
static ID | id_reset
static ID | id_update
static ID | id_finish
static ID | id_digest
static ID | id_hexdigest
static ID | id_digest_length
static ID | id_metadata

## Function Documentation

static rb_digest_metadata_t* get_digest_base_metadata | ( | VALUE | klass | ) |
| static

Definition at line 488 of file digest.c.

References rb_digest_metadata_t::api_version, Data_Get_Struct, id_metadata, NIL_P(), obj, p, rb_class_superclass(), rb_eRuntimeError, rb_ivar_defined(), rb_ivar_get(), and rb_raise().

Referenced by rb_digest_base_alloc(), rb_digest_base_block_length(), rb_digest_base_copy(), rb_digest_base_digest_length(), rb_digest_base_finish(), rb_digest_base_reset(), and rb_digest_base_update().

static VALUE hexencode_str_new | ( | VALUE | str_digest | ) |
| static

Definition at line 82 of file digest.c.

References i, LONG_MAX, p, rb_eRuntimeError, rb_raise(), rb_usascii_str_new(), RSTRING_LEN, RSTRING_PTR, str, and StringValue.

Referenced by rb_digest_class_s_hexdigest(), rb_digest_instance_hexdigest(), rb_digest_instance_hexdigest_bang(), and rb_digest_s_hexencode().

void Init_digest | ( | void |  | ) |

Definition at line 639 of file digest.c.

References id_digest, id_digest_length, id_finish, id_hexdigest, id_metadata, id_reset, id_update, rb_cDigest_Base, rb_cDigest_Class, rb_cObject, rb_define_alloc_func(), rb_define_class_under(), rb_define_method(), rb_define_module(), rb_define_module_function(), rb_define_module_under(), rb_define_private_method(), rb_define_singleton_method(), rb_digest_base_alloc(), rb_digest_base_block_length(), rb_digest_base_copy(), rb_digest_base_digest_length(), rb_digest_base_finish(), rb_digest_base_reset(), rb_digest_base_update(), rb_digest_class_init(), rb_digest_class_s_digest(), rb_digest_class_s_hexdigest(), rb_digest_instance_block_length(), rb_digest_instance_digest(), rb_digest_instance_digest_bang(), rb_digest_instance_digest_length(), rb_digest_instance_equal(), rb_digest_instance_finish(), rb_digest_instance_hexdigest(), rb_digest_instance_hexdigest_bang(), rb_digest_instance_inspect(), rb_digest_instance_length(), rb_digest_instance_new(), rb_digest_instance_reset(), rb_digest_instance_to_s(), rb_digest_instance_update(), rb_digest_s_hexencode(), rb_include_module(), rb_intern, rb_mDigest, and rb_mDigest_Instance.

RUBY_EXTERN void Init_digest_base | ( | void |  | ) |

NORETURN | ( | static void | rb_digest_instance_method_unimplVALUE self, const char *method | ) |

static VALUE rb_digest_base_alloc | ( | VALUE | klass | ) |
| static

Definition at line 522 of file digest.c.

References rb_digest_metadata_t::ctx_size, Data_Wrap_Struct(), get_digest_base_metadata(), rb_digest_metadata_t::init_func, obj, rb_cDigest_Base, rb_eNotImpError, rb_raise(), xfree, and xmalloc.

Referenced by Init_digest().

static VALUE rb_digest_base_block_length | ( | VALUE | self | ) |
| static

Definition at line 629 of file digest.c.

References rb_digest_metadata_t::block_len, get_digest_base_metadata(), INT2NUM, and rb_obj_class().

Referenced by Init_digest().

static VALUE rb_digest_base_copy | ( | VALUE | copy,
|  | VALUE | obj
| ) |  |
| static

Definition at line 544 of file digest.c.

References rb_digest_metadata_t::ctx_size, Data_Get_Struct, get_digest_base_metadata(), memcpy(), rb_check_frozen, and rb_obj_class().

Referenced by Init_digest().

static VALUE rb_digest_base_digest_length | ( | VALUE | self | ) |
| static

Definition at line 618 of file digest.c.

References rb_digest_metadata_t::digest_len, get_digest_base_metadata(), INT2NUM, and rb_obj_class().

Referenced by Init_digest().

static VALUE rb_digest_base_finish | ( | VALUE | self | ) |
| static

Definition at line 597 of file digest.c.

References Data_Get_Struct, rb_digest_metadata_t::digest_len, rb_digest_metadata_t::finish_func, get_digest_base_metadata(), rb_digest_metadata_t::init_func, rb_obj_class(), rb_str_new(), RSTRING_PTR, and str.

Referenced by Init_digest().

static VALUE rb_digest_base_reset | ( | VALUE | self | ) |
| static

Definition at line 564 of file digest.c.

References Data_Get_Struct, get_digest_base_metadata(), rb_digest_metadata_t::init_func, and rb_obj_class().

Referenced by Init_digest().

static VALUE rb_digest_base_update | ( | VALUE | self,
|  | VALUE | str
| ) |  |
| static

Definition at line 580 of file digest.c.

References Data_Get_Struct, get_digest_base_metadata(), rb_obj_class(), RSTRING_LEN, RSTRING_PTR, StringValue, and rb_digest_metadata_t::update_func.

Referenced by Init_digest().

static VALUE rb_digest_class_init | ( | VALUE | self | ) |
| static

Definition at line 475 of file digest.c.

Referenced by Init_digest().

static VALUE rb_digest_class_s_digest | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |
| static

Definition at line 439 of file digest.c.

References id_digest, obj, rb_eArgError, rb_funcall(), rb_obj_alloc(), rb_obj_call_init(), rb_raise(), str, and StringValue.

Referenced by Init_digest().

static VALUE rb_digest_class_s_hexdigest | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | klass
| ) |  |
| static

Definition at line 468 of file digest.c.

References hexencode_str_new(), id_digest, and rb_funcall2().

Referenced by Init_digest().

static VALUE rb_digest_instance_block_length | ( | VALUE | self | ) |
| static

Definition at line 415 of file digest.c.

References rb_digest_instance_method_unimpl(), and UNREACHABLE.

Referenced by Init_digest().

static VALUE rb_digest_instance_digest | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 225 of file digest.c.

References id_finish, id_reset, id_update, rb_funcall(), rb_obj_clone(), rb_scan_args(), str, and value.

Referenced by Init_digest(), rb_digest_instance_digest_length(), and rb_digest_instance_equal().

static VALUE rb_digest_instance_digest_bang | ( | VALUE | self | ) |
| static

Definition at line 249 of file digest.c.

References id_finish, id_reset, rb_funcall(), and value.

Referenced by Init_digest().

static VALUE rb_digest_instance_digest_length | ( | VALUE | self | ) |
| static

Definition at line 383 of file digest.c.

References INT2NUM, rb_digest_instance_digest(), RSTRING_LEN, and StringValue.

Referenced by Init_digest().

static VALUE rb_digest_instance_equal | ( | VALUE | self,
|  | VALUE | other
| ) |  |
| static

Definition at line 350 of file digest.c.

References Qfalse, Qtrue, rb_digest_instance_digest(), rb_digest_instance_to_s(), rb_mDigest_Instance, rb_obj_is_kind_of(), rb_str_cmp(), RSTRING_LEN, and StringValue.

Referenced by Init_digest().

static VALUE rb_digest_instance_finish | ( | VALUE | self | ) |
| static

Definition at line 174 of file digest.c.

References rb_digest_instance_method_unimpl(), and UNREACHABLE.

Referenced by Init_digest().

static VALUE rb_digest_instance_hexdigest | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | self
| ) |  |
| static

Definition at line 270 of file digest.c.

References hexencode_str_new(), id_finish, id_reset, id_update, rb_funcall(), rb_obj_clone(), rb_scan_args(), str, and value.

Referenced by Init_digest(), and rb_digest_instance_inspect().

static VALUE rb_digest_instance_hexdigest_bang | ( | VALUE | self | ) |
| static

Definition at line 294 of file digest.c.

References hexencode_str_new(), id_finish, id_reset, rb_funcall(), and value.

Referenced by Init_digest().

static VALUE rb_digest_instance_inspect | ( | VALUE | self | ) |
| static

Definition at line 321 of file digest.c.

References rb_digest_instance_hexdigest(), rb_obj_classname(), rb_str_buf_append(), rb_str_buf_cat2(), rb_str_buf_new(), str, and strlen().

Referenced by Init_digest().

static VALUE rb_digest_instance_length | ( | VALUE | self | ) |
| static

Definition at line 401 of file digest.c.

References id_digest_length, and rb_funcall().

Referenced by Init_digest().

static void rb_digest_instance_method_unimpl | ( | VALUE | self,
|  | const char * | method
| ) |  |
| static

Definition at line 136 of file digest.c.

References rb_eRuntimeError, rb_obj_classname(), and rb_raise().

Referenced by rb_digest_instance_block_length(), rb_digest_instance_finish(), rb_digest_instance_reset(), and rb_digest_instance_update().

static VALUE rb_digest_instance_new | ( | VALUE | self | ) |
| static

Definition at line 205 of file digest.c.

References id_reset, rb_funcall(), and rb_obj_clone().

Referenced by Init_digest().

static VALUE rb_digest_instance_reset | ( | VALUE | self | ) |
| static

Definition at line 190 of file digest.c.

References rb_digest_instance_method_unimpl(), and UNREACHABLE.

Referenced by Init_digest().

static VALUE rb_digest_instance_to_s | ( | VALUE | self | ) |
| static

Definition at line 309 of file digest.c.

References id_hexdigest, and rb_funcall().

Referenced by Init_digest(), and rb_digest_instance_equal().

static VALUE rb_digest_instance_update | ( | VALUE | self,
|  | VALUE | str
| ) |  |
| static

Definition at line 154 of file digest.c.

References rb_digest_instance_method_unimpl(), and UNREACHABLE.

Referenced by Init_digest().

static VALUE rb_digest_s_hexencode | ( | VALUE | klass,
|  | VALUE | str
| ) |  |
| static

Definition at line 121 of file digest.c.

References hexencode_str_new().

Referenced by Init_digest().

## Variable Documentation

ID id_digest
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), rb_digest_class_s_digest(), and rb_digest_class_s_hexdigest().

ID id_digest_length
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), and rb_digest_instance_length().

ID id_finish
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), rb_digest_instance_digest(), rb_digest_instance_digest_bang(), rb_digest_instance_hexdigest(), and rb_digest_instance_hexdigest_bang().

ID id_hexdigest
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), and rb_digest_instance_to_s().

ID id_metadata
| static

Definition at line 24 of file digest.c.

Referenced by get_digest_base_metadata(), Init_digest(), and Init_sha2().

ID id_reset
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), rb_digest_instance_digest(), rb_digest_instance_digest_bang(), rb_digest_instance_hexdigest(), rb_digest_instance_hexdigest_bang(), and rb_digest_instance_new().

ID id_update
| static

Definition at line 23 of file digest.c.

Referenced by Init_digest(), rb_digest_instance_digest(), and rb_digest_instance_hexdigest().

VALUE rb_cDigest_Base
| static

Definition at line 21 of file digest.c.

Referenced by Init_digest(), and rb_digest_base_alloc().

VALUE rb_cDigest_Class
| static

Definition at line 20 of file digest.c.

Referenced by Init_digest().

VALUE rb_mDigest
| static

Definition at line 18 of file digest.c.

Referenced by Init_digest().

VALUE rb_mDigest_Instance
| static

Definition at line 19 of file digest.c.

Referenced by Init_digest(), and rb_digest_instance_equal().