summaryrefslogtreecommitdiff
path: root/ext/digest/digest.c
AgeCommit message (Collapse)Author
2010-01-17* ext/digest/digest.c (rb_digest_instance_hexdigest_bang): Fixknu
rdoc. * ext/digest/lib/digest.rb (Digest::Class.base64digest) (Digest::Instance#base64digest{,!}): New methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-17* ext/digest/digest.c (rb_digest_instance_digest)knu
(rb_digest_instance_hexdigest): Save a method call of reset() for a disposable clone. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-31* ext/digest/digest.c (rb_digest_instance_method_unimpl): Suppressknu
compiler warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-25* ext/digest/digest.c (rb_digest_instance_method_unimpl): Do notknu
call rb_inspect() on an object that does not implement necessary methods; reported by NaHi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-16* ext/bigdecimal/bigdecimal.c (VpMidRound): remove warnings.naruse
patch from Charlie Savage. [ruby-core:22869] * ext/digest/bubblebabble/bubblebabble.c (bubblebabble_str_new): ditto. * ext/digest/digest.c (hexencode_str_new): ditto. * ext/iconv/iconv.c (iconv_convert): ditto. * ext/socket/socket.c (inspect_sockaddr): ditto. * ext/socket/raddrinfo.c (sockaddr_obj): ditto. * ext/syck/emitter.c (syck_emitter_write): ditto. * ext/syck/emitter.c (syck_emitter_flush): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-01 * ext/digest/digest.c (rb_digest_instance_inspect): constified.shyouhei
* variable.c (rb_path2class): field precision should have type int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-09-28* include/ruby/intern.h: export rb_ivar_foreach.akr
* include/ruby/ruby.h: modify struct RObject and RClass for optimizing T_OBJECT space. [ruby-dev:31853] (ROBJECT_LEN, ROBJECT_PTR) (RCLASS_IV_TBL, RCLASS_M_TBL, RCLASS_SUPER, RCLASS_IV_INDEX_TBL) (RMODULE_IV_TBL, RMODULE_M_TBL, RMODULE_SUPER): abstract accessor defined. * variable.c: support the modified RObject and RClass. * object.c: ditto. * class.c: ditto. * gc.c: ditto. * marshal.c: ditto. * eval_method.ci: use the abstract accessor. * insns.def: ditto. * proc.c: ditto. * struct.c: ditto. * eval.c: ditto. * error.c: ditto. * vm.c: ditto. * insnhelper.ci: ditto. * ext/digest/digest.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-07-15* ext/dl/cfunc.c (rb_dlcfunc_call): adjust format. [ruby-dev:31222]nobu
* ext/digest/digest.c (rb_digest_instance_update, rb_digest_instance_finish, rb_digest_instance_reset, rb_digest_instance_block_length): %s in rb_raise() expects char*. [ruby-dev:31222] * ext/openssl/ossl.h: include ossl_pkcs5.h. [ruby-dev:31231] * ext/openssl/ossl_pkcs5.h: new file for PKCS5. [ruby-dev:31231] * ext/openssl/ossl_x509name.c (ossl_x509name_to_s): use ossl_raise() instead of rb_raise(). [ruby-dev:31222] * ext/sdbm/_sdbm.c: DOSISH platforms need io.h. [ruby-dev:31232] * ext/syck/syck.h: include stdlib.h for malloc() and free(). [ruby-dev:31232] * ext/syck/syck.h (syck_parser_set_input_type): prototype added. [ruby-dev:31231] * win32/win32.c: include mbstring.h for _mbspbrk(). [ruby-dev:31232] * include/ruby/win32.h (rb_w32_getcwd): prototype added. [ruby-dev:31232] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-28better error messageknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-28* ext/digest/digest.c (get_digest_base_metadata): Allow inheritingknu
Digest::Base subclasses, which was unintentionally made impossible while restructuring Digest classes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-02-27* ext/bigdecimal/bigdecimal.c (BigDecimal_load): Silence warningsknu
regarding char * vs. unsigned char * mismatch; submitted by Lyle Johnson <lyle.johnson@gmail.com> in [ruby-core:10416]. * ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto. * ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto. * ext/digest/digest.c (rb_digest_base_finish, rb_digest_base_update): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-11-01* ext/digest/lib/digest/hmac.rb (Digest::HMAC::update): Minorknu
optimization. * ext/digest/digest.c (rb_digest_instance_equal): Allow comparing a digest instance with another of a different class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-26* ext/digest/digest.c (Init_digest): typo.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-20* ext/digest: Prefix C constants with RUBY_ and C type names withknu
rb_ to avoid name clash in writing extensions. * ext/digest: Introduce Digest::Class and Digest::Instance for ease of implementing subclasses and add-ons, inspried by gotoyuzo. * ext/digest: The Digest::Instance module now requires and assumes that any instance be resettable and clonable, and add some convenient instance methods such as "new()", for creating a new copy, parameter taking "digest()" and "hexdigest()", for instant calculation. These methods make digest instances work just like digest classes. * ext/digest/sha2/lib/digest/sha2.rb: Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256, SHA384 and SHA512, hoping this module would make a decent example of a digest subclass written in Ruby. * ext/digest/lib/digest.rb: Adjust autoload entries for SHA2 classes. * ext/digest/lib/digest/hmac.rb: Follow the framework updates. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c, ext/digest/digest.h,knu
ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Introduce API versioning. * ext/digest/digest.c, ext/digest/digest.h, ext/digest/md5/md5init.c, ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Remove the constants DIGEST_LENGTH and BLOCK_LENGTH and turn them into instance methods digest_length() and block_length(). Class methods with the same names are also provided, which take extra parameters for a digest method. * ext/digest/lib/digest/hmac.rb: Completely redesign the API which is similar to Perl's, now that Digest classes can take hashing parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c: Improve RDoc documentation further more.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c: Improve RDoc documentation.knu
* ext/digest/digest.c (Init_digest, rb_digest_base_s_digest, rb_digest_base_s_hexdigest): Make Digest::Base::digest() and Digest::Base::hexdigest() take extra arguments, which are passed through to the constructor in an internal call. * ext/digest/bubblebabble/bubblebabble.c (rb_digest_base_s_bubblebabble): Ditto for Digest::Base::bubblebabble(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c (Init_digest): Digest::Base.new() does noknu
longer take an initial string to feed. This change allows subclasses to take hashing parameters. A statement such as ``md = Digest::MD5.new(s)'' can be easily rewritten as ``md = Digest::MD5.new << s'' or ``md = Digest::MD5.new.update(s)''. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c, ext/digest/md5/md5init.c,knu
ext/digest/rmd160/rmd160init.c, ext/digest/sha1/sha1init.c, ext/digest/sha2/sha2init.c: Add RDoc documentation. * ext/digest/digest.txt, ext/digest/digest.txt.ja: Removed in favor of embedded RDoc documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/bubblebabble, ext/digest/digest.c: Rip BubbleBabbleknu
support out of the base class and have a separate module named digest/bubblebabble. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13* ext/digest/digest.c (rb_digest_base_equal): Again, should callknu
digest() of a subclass instead of the one defined in the base class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-12* ext/digest/digest.c (rb_digest_base_equal): Should call digest()knu
of a subclass instead of the one defined in the base class. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11* ext/digest/digest.c (get_digest_base_metadata): Use an instanceknu
variable of a class object instead of a class variable for metadata. This change is crucial for ruby 1.8 and applying it also to the trunk will assure compatibilities. * ext/digest/md5/md5init.c (Init_md5): Ditto. * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto. * ext/digest/sha1/sha1init.c (Init_sha1): Ditto. * ext/digest/sha2/sha2init.c (Init_sha2): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11* ext/digest/digest.c (rb_digest_base_alloc,knu
rb_digest_base_equal): Simplify the equality check and just compare resulted digests since state-level equality should not be significant. * ext/digest/digest.h: Ditto. * ext/digest/*/*.[ch]: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11* ext/digest/digest.c (rb_digest_base_reset): Do not makeknu
recursive calls, but call initialize() when reset() is not defined in a subclass. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-11* ext/digest/digest.c (rb_digest_base_reset, Init_digest): Addknu
Digest::Base#reset. * ext/digest/digest.h: Update the header comment. * ext/digest/md5/md5ossl.h, ext/digest/md5/md5init.c (Init_md5): Define DIGEST_LENGTH and BLOCK_LENGTH. * ext/digest/rmd160/rmd160init.c (Init_rmd160): Ditto. * ext/digest/sha1/sha1init.c (Init_sha1): Ditto. * ext/digest/sha2/sha2init.c (Init_sha2): Ditto. * ext/digest/depend, ext/digest/extconf.rb: Use $INSTALLFILES rather than adding make targets. [Pointed out by: nobu] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-10* ext/digest/digest.c (hexdigest_str_new, bubblebabble_str_new):knu
Perform StringValue() checks properly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05* ext/digest/digest.c: Make hexdigest() always call digest() internally.knu
* ext/digest/digest.c: Add bubblebabble(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05* ext/digest/digest.c: Allow subclassing in Ruby.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05* ext/digest/digest.c (hexdigest_str_new): Add a string size check.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-05* ext/digest/digest.[ch]: Since the argument order ofknu
hash_final_func_t was inconsistent with others, change it and rename to hash_finish_func_t to avoid confusion. * ext/digest/digest.[ch]: Remove and eliminate the use of hash_end_func_t. Implement hexdigest conversion in the base class. * ext/digest/md5/md5.c, ext/digest/md5/md5.h, ext/digest/md5/md5init.c, ext/digest/md5/md5ossl.c, ext/digest/md5/md5ossl.h: Remove MD5_End() and change MD5_Final() to MD5_Finish(). * ext/digest/rmd160/depend, ext/digest/rmd160/extconf.rb, ext/digest/rmd160/rmd160.c, ext/digest/rmd160/rmd160.h, ext/digest/rmd160/rmd160hl.c, ext/digest/rmd160/rmd160init.c, ext/digest/rmd160/rmd160ossl.c, ext/digest/rmd160/rmd160ossl.h: Remove unused functions RMD160_End(), RMD160_File(), RMD160_Data() and change RMD160_Final() to RMD160_Finish(). * ext/digest/sha1/extconf.rb, ext/digest/sha1/sha1.c, ext/digest/sha1/sha1.h, ext/digest/sha1/sha1hl.c, ext/digest/sha1/sha1init.c, ext/digest/sha1/sha1ossl.c, ext/digest/sha1/sha1ossl.h: Likewise. * ext/digest/sha2/extconf.rb, ext/digest/sha2/sha2.c, ext/digest/sha2/sha2.h, ext/digest/sha2/sha2hl.c, ext/digest/sha2/sha2init.c: Likewise. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-13* ext/digest/digest.c (rb_digest_base_inspect): new method.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31* ruby.h (struct RString): embed small strings.matz
(RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-28Make RDoc show up.drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-27Include attributiondrbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12remove unused variables.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-12-12* ext/digest/digest.c (rb_digest_base_s_digest): add volatile tomatz
protect temporary context object. [ruby-dev:27979] * ext/iconv/iconv.c (Init_iconv): rb_gc_register_address() should be called before actual variable initialization. [ruby-dev:27986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-17* array.c (rb_ary_delete): element comparison might change arraymatz
size. [ruby-dev:24273] * parse.y: make ruby parser reentrant. merge ripper parser to the real one. this change makes ruby require bison. * file.c (rb_file_truncate): clear stdio buffer before truncating the file. [ruby-dev:24191] * ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF which might return singleton class. [ruby-dev:24202] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-15Add a XXX comment.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-15* ext/digest/digest.c (rb_digest_base_alloc): need to initializeusa
buffer. [ruby-dev:21622] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-09-29* eval.c (rb_thread_atfork): wrong format specifier.matz
[ruby-dev:21428] * process.c (pst_inspect): better description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-21* array.c (ary_alloc), dir.c (dir_s_alloc), eval.c (thgroup_s_alloc),usa
file.c (rb_stat_s_alloc), hash.c (hash_alloc), io.c (io_alloc), object.c (rb_module_s_alloc, rb_class_allocate_instance), re.c (match_alloc, rb_reg_s_alloc), string.c (str_alloc), time.c (time_s_alloc), ext/digest/digest.c (rb_digest_base_alloc), ext/tcltklib/tcltklib.c (ip_alloc), ext/win32ole/win32ole.c (fole_s_allocate, fev_s_allocate) : add prototype to get rid of VC++ warnings. * ext/sdbm/init.c (fsdbm_alloc): allocator takes only one argument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-20* ext/curses/curses.c, ext/digest/digest.c, ext/dl/handle.c,nobu
ext/dl/ptr.c, ext/dl/sym.c, ext/gdbm/gdbm.c, ext/iconv/iconv.c, ext/stringio/stringio.c, ext/strscan/strscan.c, ext/tcltklib/tcltklib.c, ext/win32ole/win32ole.c: use rb_define_alloc_func(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-12-11* ext/digest/digest.c (rb_digest_base_copy): renamed "become".nobu
* ext/stringio/stringio.c (strio_copy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-26* ext/digest/digest.c (rb_digest_base_s_digest): Fix a doubleknu
free() bug mingled with allocation framework deployment. * ext/digest/digest.c (rb_digest_base_s_hexdigest): Get rid of redundant struct allocation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-05= should be ==matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-04Fix rb_digest_base_become (ruby-core:428)michal
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-04* class.c (rb_make_metaclass): obj.meta.super.meta should be equalmatz
to obj.meta.meta.super (ruby-bugs-ja:PR#324). * parse.y (yylex): the warning message "invalid character syntax" was never issued. * marshal.c (r_bytes): do not use alloca (ruby-bugs:PR#382). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2002-09-03 * variable.c (rb_copy_generic_ivar): remove old generic instancematz
variable table if it existes. * class.c (rb_make_metaclass): metaclass of a metaclass is a metaclass itself. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e