2001-07-13 16:06:14 -04:00
|
|
|
/************************************************
|
|
|
|
|
2006-10-11 01:15:15 -04:00
|
|
|
digest.h - header file for ruby digest modules
|
2001-07-13 16:06:14 -04:00
|
|
|
|
|
|
|
$Author$
|
|
|
|
created at: Fri May 25 08:54:56 JST 2001
|
|
|
|
|
|
|
|
|
2006-10-11 01:15:15 -04:00
|
|
|
Copyright (C) 2001-2006 Akinori MUSHA
|
2001-07-13 16:06:14 -04:00
|
|
|
|
|
|
|
$RoughId: digest.h,v 1.3 2001/07/13 15:38:27 knu Exp $
|
|
|
|
$Id$
|
|
|
|
|
|
|
|
************************************************/
|
|
|
|
|
|
|
|
#include "ruby.h"
|
|
|
|
|
2014-07-15 10:58:53 -04:00
|
|
|
#define RUBY_DIGEST_API_VERSION 3
|
2006-10-20 08:48:35 -04:00
|
|
|
|
2014-07-15 10:58:53 -04:00
|
|
|
typedef int (*rb_digest_hash_init_func_t)(void *);
|
2006-10-20 08:48:35 -04:00
|
|
|
typedef void (*rb_digest_hash_update_func_t)(void *, unsigned char *, size_t);
|
2014-07-15 10:58:53 -04:00
|
|
|
typedef int (*rb_digest_hash_finish_func_t)(void *, unsigned char *);
|
2001-07-13 16:06:14 -04:00
|
|
|
|
|
|
|
typedef struct {
|
* 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:
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 19:23:18 -04:00
|
|
|
int api_version;
|
2001-07-13 16:06:14 -04:00
|
|
|
size_t digest_len;
|
* 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:
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 19:23:18 -04:00
|
|
|
size_t block_len;
|
2001-07-13 16:06:14 -04:00
|
|
|
size_t ctx_size;
|
2006-10-20 08:48:35 -04:00
|
|
|
rb_digest_hash_init_func_t init_func;
|
|
|
|
rb_digest_hash_update_func_t update_func;
|
|
|
|
rb_digest_hash_finish_func_t finish_func;
|
|
|
|
} rb_digest_metadata_t;
|