summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-24 08:20:50 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-02-24 08:20:50 +0000
commitd9479e72a682af54db9a802b3085670de719a4a8 (patch)
treefe4f820431ed1b67f6758d02b58e0c989d58030c
parent018c5191bfc13be1c002f4fff64b572a031a4a7a (diff)
Merge from rough.
- Avoid namespace pollution. (MD5_* -> rb_Digest_MD5_*, etc.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/digest/md5/md5.h10
-rw-r--r--ext/digest/rmd160/rmd160.h15
-rw-r--r--ext/digest/sha1/sha1.h15
-rw-r--r--ext/digest/sha2/sha2.h28
4 files changed, 64 insertions, 4 deletions
diff --git a/ext/digest/md5/md5.h b/ext/digest/md5/md5.h
index 4b1f00b3ec2..fc41380d383 100644
--- a/ext/digest/md5/md5.h
+++ b/ext/digest/md5/md5.h
@@ -40,7 +40,7 @@
*/
/* $OrigId: md5.h,v 1.2 2001/03/26 08:57:14 matz Exp $ */
-/* $RoughId: md5.h,v 1.2 2001/07/13 19:48:41 knu Exp $ */
+/* $RoughId: md5.h,v 1.3 2002/02/24 08:14:31 knu Exp $ */
/* $Id$ */
#ifndef MD5_INCLUDED
@@ -62,6 +62,14 @@ typedef struct md5_state_s {
uint8_t buffer[64]; /* accumulate block */
} MD5_CTX;
+#ifdef RUBY
+#define MD5_Init rb_Digest_MD5_Init
+#define MD5_Update rb_Digest_MD5_Update
+#define MD5_Final rb_Digest_MD5_Final
+#define MD5_End rb_Digest_MD5_End
+#define MD5_Equal rb_Digest_MD5_Equal
+#endif
+
void MD5_Init _((MD5_CTX *pms));
void MD5_Update _((MD5_CTX *pms, const uint8_t *data, size_t nbytes));
void MD5_Final _((uint8_t *digest, MD5_CTX *pms));
diff --git a/ext/digest/rmd160/rmd160.h b/ext/digest/rmd160/rmd160.h
index 53c1e0c1e07..24f9a025f00 100644
--- a/ext/digest/rmd160/rmd160.h
+++ b/ext/digest/rmd160/rmd160.h
@@ -1,5 +1,5 @@
/* $NetBSD: rmd160.h,v 1.2 2000/07/07 10:47:06 ad Exp $ */
-/* $RoughId: rmd160.h,v 1.2 2001/07/13 19:49:10 knu Exp $ */
+/* $RoughId: rmd160.h,v 1.3 2002/02/24 08:14:31 knu Exp $ */
/* $Id$ */
/********************************************************************\
@@ -35,6 +35,19 @@ typedef struct {
uint32_t buflen; /* number of chars in bbuffer */
} RMD160_CTX;
+#ifdef RUBY
+#define RMD160_Init rb_Digest_RMD160_Init
+#define RMD160_Transform rb_Digest_RMD160_Transform
+#define RMD160_Update rb_Digest_RMD160_Update
+#define RMD160_Final rb_Digest_RMD160_Final
+#define RMD160_Equal rb_Digest_RMD160_Equal
+#ifndef _KERNEL
+#define RMD160_End rb_Digest_RMD160_End
+#define RMD160_File rb_Digest_RMD160_File
+#define RMD160_Data rb_Digest_RMD160_Data
+#endif /* _KERNEL */
+#endif
+
__BEGIN_DECLS
void RMD160_Init _((RMD160_CTX *));
void RMD160_Transform _((uint32_t[5], const uint32_t[16]));
diff --git a/ext/digest/sha1/sha1.h b/ext/digest/sha1/sha1.h
index 22e06d29b89..2303cecc2be 100644
--- a/ext/digest/sha1/sha1.h
+++ b/ext/digest/sha1/sha1.h
@@ -1,5 +1,5 @@
/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
-/* $RoughId: sha1.h,v 1.2 2001/07/13 19:49:10 knu Exp $ */
+/* $RoughId: sha1.h,v 1.3 2002/02/24 08:14:32 knu Exp $ */
/* $Id$ */
/*
@@ -19,6 +19,19 @@ typedef struct {
uint8_t buffer[64];
} SHA1_CTX;
+#ifdef RUBY
+#define SHA1_Transform rb_Digest_SHA1_Transform
+#define SHA1_Init rb_Digest_SHA1_Init
+#define SHA1_Update rb_Digest_SHA1_Update
+#define SHA1_Final rb_Digest_SHA1_Final
+#define SHA1_Equal rb_Digest_SHA1_Equal
+#ifndef _KERNEL
+#define SHA1_End rb_Digest_SHA1_End
+#define SHA1_File rb_Digest_SHA1_File
+#define SHA1_Data rb_Digest_SHA1_Data
+#endif /* _KERNEL */
+#endif
+
void SHA1_Transform _((uint32_t state[5], const uint8_t buffer[64]));
void SHA1_Init _((SHA1_CTX *context));
void SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
diff --git a/ext/digest/sha2/sha2.h b/ext/digest/sha2/sha2.h
index f5c7fd42aa8..4689ad93ce6 100644
--- a/ext/digest/sha2/sha2.h
+++ b/ext/digest/sha2/sha2.h
@@ -33,7 +33,7 @@
*
*/
-/* $RoughId: sha2.h,v 1.2 2001/07/13 19:49:10 knu Exp $ */
+/* $RoughId: sha2.h,v 1.3 2002/02/24 08:14:32 knu Exp $ */
/* $Id$ */
#ifndef __SHA2_H__
@@ -74,6 +74,32 @@ typedef struct _SHA512_CTX {
typedef SHA512_CTX SHA384_CTX;
+#ifdef RUBY
+#define SHA256_Init rb_Digest_SHA256_Init
+#define SHA256_Update rb_Digest_SHA256_Update
+#define SHA256_Final rb_Digest_SHA256_Final
+#define SHA256_End rb_Digest_SHA256_End
+#define SHA256_Data rb_Digest_SHA256_Data
+#define SHA256_File rb_Digest_SHA256_File
+#define SHA256_Equal rb_Digest_SHA256_Equal
+
+#define SHA384_Init rb_Digest_SHA384_Init
+#define SHA384_Update rb_Digest_SHA384_Update
+#define SHA384_Final rb_Digest_SHA384_Final
+#define SHA384_End rb_Digest_SHA384_End
+#define SHA384_Data rb_Digest_SHA384_Data
+#define SHA384_File rb_Digest_SHA384_File
+#define SHA384_Equal rb_Digest_SHA384_Equal
+
+#define SHA512_Init rb_Digest_SHA512_Init
+#define SHA512_Update rb_Digest_SHA512_Update
+#define SHA512_Final rb_Digest_SHA512_Final
+#define SHA512_End rb_Digest_SHA512_End
+#define SHA512_Data rb_Digest_SHA512_Data
+#define SHA512_File rb_Digest_SHA512_File
+#define SHA512_Equal rb_Digest_SHA512_Equal
+#endif
+
/*** SHA-256/384/512 Function Prototypes ******************************/
void SHA256_Init _((SHA256_CTX *));
void SHA256_Update _((SHA256_CTX*, const uint8_t*, size_t));