diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-04 06:44:42 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-04 06:44:42 +0000 |
commit | a5180750f7ab485fba73dd6e9861536adf3b693b (patch) | |
tree | cd2cea7862bed69939cb64d20346a3f975b5a9cc /ossl_digest.h | |
parent | bc603852659675cd0c7420dd4d126780f7ba6ee2 (diff) | |
download | ruby-openssl-history-a5180750f7ab485fba73dd6e9861536adf3b693b.tar.gz |
Initial revision
Diffstat (limited to 'ossl_digest.h')
-rw-r--r-- | ossl_digest.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ossl_digest.h b/ossl_digest.h new file mode 100644 index 0000000..aad8e25 --- /dev/null +++ b/ossl_digest.h @@ -0,0 +1,40 @@ +/* + * $Id$ + * 'OpenSSL for Ruby' project + * Copyright (C) 2001-2002 Michal Rokos <m.rokos@sh.cvut.cz> + * 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; + +#define OSSLWrapDigest(klass, obj, ctx) do { \ + if (!ctx) { \ + rb_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \ + } \ + obj = Data_Wrap_Struct(klass, 0, CRYPTO_free, ctx); \ +} while (0) + +#define OSSLGetDigest(obj, ctx) do { \ + OSSL_Check_Instance(obj, cDigest); \ + Data_Get_Struct(obj, EVP_MD_CTX, ctx); \ + if (!ctx) { \ + rb_raise(rb_eRuntimeError, "Digest CTX wasn't initialized!"); \ + } \ +} while (0) + +#define OSSLDigestValue(obj) OSSL_Check_Instance((obj), cDigest) + +int ossl_digest_get_NID(VALUE); +const EVP_MD *ossl_digest_get_EVP_MD(VALUE); +void Init_ossl_digest(void); + +#endif /* _OSSL_DIGEST_H_ */ + |