/* * $Id$ * 'OpenSSL for Ruby' project * Copyright (C) 2001-2002 Michal Rokos * All rights reserved. */ /* * This program is licenced under the same licence as Ruby. * (See the file 'LICENCE'.) */ #if !defined(_OSSL_DIGEST_H_) #define _OSSL_DIGEST_H_ extern VALUE mDigest; extern VALUE cDigest; extern VALUE eDigestError; const EVP_MD *GetDigestPtr(VALUE); void Init_ossl_digest(void); #define GetDigest(obj, ctx) do { \ Data_Get_Struct(obj, EVP_MD_CTX, ctx); \ if (!ctx) { \ ossl_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \ } \ } while (0) #define SafeGetDigest(obj, ctx) do { \ OSSL_Check_Kind(obj, cDigest); \ GetDigest(obj, ctx); \ } while (0) #endif /* _OSSL_DIGEST_H_ */