6 #if defined(SHA2_USE_OPENSSL) 8 #elif defined(SHA2_USE_COMMONDIGEST) 14 #define FOREACH_BITLEN(func) func(256) func(384) func(512) 16 #define DEFINE_ALGO_METADATA(bitlen) \ 17 static const rb_digest_metadata_t sha##bitlen = { \ 18 RUBY_DIGEST_API_VERSION, \ 19 SHA##bitlen##_DIGEST_LENGTH, \ 20 SHA##bitlen##_BLOCK_LENGTH, \ 21 sizeof(SHA##bitlen##_CTX), \ 22 (rb_digest_hash_init_func_t)SHA##bitlen##_Init, \ 23 (rb_digest_hash_update_func_t)SHA##bitlen##_Update, \ 24 (rb_digest_hash_finish_func_t)SHA##bitlen##_Finish, \ 37 VALUE mDigest, cDigest_Base;
40 #define DECLARE_ALGO_CLASS(bitlen) \ 41 VALUE cDigest_SHA##bitlen; 52 #define DEFINE_ALGO_CLASS(bitlen) \ 53 cDigest_SHA##bitlen = rb_define_class_under(mDigest, "SHA" #bitlen, cDigest_Base); \ 55 rb_ivar_set(cDigest_SHA##bitlen, id_metadata, \ 56 Data_Wrap_Struct(0, 0, 0, (void *)&sha##bitlen)); 58 #undef RUBY_UNTYPED_DATA_WARNING 59 #define RUBY_UNTYPED_DATA_WARNING 0 #define DEFINE_ALGO_METADATA(bitlen)
VALUE rb_path2class(const char *)
VALUE rb_require(const char *)
#define DEFINE_ALGO_CLASS(bitlen)
#define DECLARE_ALGO_CLASS(bitlen)
#define rb_intern_const(str)
#define FOREACH_BITLEN(func)