From 41fa6056ba08e7a94d60e10825d271fbd1fa5596 Mon Sep 17 00:00:00 2001 From: technorama Date: Thu, 29 Mar 2007 17:29:03 +0000 Subject: * ext/openssl/ossl_{bn,cipher,digest,hmac,rand,pkey_{dh,dsa,rsa}}.c: Add Documentation for various methods. * ext/openssl/lib/openssl/cipher.rb: Ditto * ext/openssl/ossl_bn.c: add lshift! and rshift! methods. * ext/openssl/ossl_digest.c: GetDigestPtr() also accept a string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/ossl_hmac.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'ext/openssl/ossl_hmac.c') diff --git a/ext/openssl/ossl_hmac.c b/ext/openssl/ossl_hmac.c index b06823a932..84d378f732 100644 --- a/ext/openssl/ossl_hmac.c +++ b/ext/openssl/ossl_hmac.c @@ -57,6 +57,12 @@ ossl_hmac_alloc(VALUE klass) return obj; } + +/* + * call-seq: + * HMAC.new(key, digest) -> hmac + * + */ static VALUE ossl_hmac_initialize(VALUE self, VALUE key, VALUE digest) { @@ -87,6 +93,11 @@ ossl_hmac_copy(VALUE self, VALUE other) return self; } +/* + * call-seq: + * hmac.update(string) -> self + * + */ static VALUE ossl_hmac_update(VALUE self, VALUE data) { @@ -116,6 +127,11 @@ hmac_final(HMAC_CTX *ctx, char **buf, int *buf_len) HMAC_CTX_cleanup(&final); } +/* + * call-seq: + * hmac.digest -> aString + * + */ static VALUE ossl_hmac_digest(VALUE self) { @@ -131,6 +147,11 @@ ossl_hmac_digest(VALUE self) return digest; } +/* + * call-seq: + * hmac.hexdigest -> aString + * + */ static VALUE ossl_hmac_hexdigest(VALUE self) { @@ -151,6 +172,11 @@ ossl_hmac_hexdigest(VALUE self) return hexdigest; } +/* + * call-seq: + * HMAC.digest(digest, key, data) -> aString + * + */ static VALUE ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data) { @@ -165,6 +191,11 @@ ossl_hmac_s_digest(VALUE klass, VALUE digest, VALUE key, VALUE data) return rb_str_new(buf, buf_len); } +/* + * call-seq: + * HMAC.digest(digest, key, data) -> aString + * + */ static VALUE ossl_hmac_s_hexdigest(VALUE klass, VALUE digest, VALUE key, VALUE data) { -- cgit v1.2.3