зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
018c5191bf
Коммит
d9479e72a6
|
@ -40,7 +40,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $OrigId: md5.h,v 1.2 2001/03/26 08:57:14 matz Exp $ */
|
/* $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$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#ifndef MD5_INCLUDED
|
#ifndef MD5_INCLUDED
|
||||||
|
@ -62,6 +62,14 @@ typedef struct md5_state_s {
|
||||||
uint8_t buffer[64]; /* accumulate block */
|
uint8_t buffer[64]; /* accumulate block */
|
||||||
} MD5_CTX;
|
} 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_Init _((MD5_CTX *pms));
|
||||||
void MD5_Update _((MD5_CTX *pms, const uint8_t *data, size_t nbytes));
|
void MD5_Update _((MD5_CTX *pms, const uint8_t *data, size_t nbytes));
|
||||||
void MD5_Final _((uint8_t *digest, MD5_CTX *pms));
|
void MD5_Final _((uint8_t *digest, MD5_CTX *pms));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $NetBSD: rmd160.h,v 1.2 2000/07/07 10:47:06 ad Exp $ */
|
/* $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$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
|
@ -35,6 +35,19 @@ typedef struct {
|
||||||
uint32_t buflen; /* number of chars in bbuffer */
|
uint32_t buflen; /* number of chars in bbuffer */
|
||||||
} RMD160_CTX;
|
} 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
|
__BEGIN_DECLS
|
||||||
void RMD160_Init _((RMD160_CTX *));
|
void RMD160_Init _((RMD160_CTX *));
|
||||||
void RMD160_Transform _((uint32_t[5], const uint32_t[16]));
|
void RMD160_Transform _((uint32_t[5], const uint32_t[16]));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* $NetBSD: sha1.h,v 1.2 1998/05/29 22:55:44 thorpej Exp $ */
|
/* $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$ */
|
/* $Id$ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -19,6 +19,19 @@ typedef struct {
|
||||||
uint8_t buffer[64];
|
uint8_t buffer[64];
|
||||||
} SHA1_CTX;
|
} 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_Transform _((uint32_t state[5], const uint8_t buffer[64]));
|
||||||
void SHA1_Init _((SHA1_CTX *context));
|
void SHA1_Init _((SHA1_CTX *context));
|
||||||
void SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
|
void SHA1_Update _((SHA1_CTX *context, const uint8_t *data, size_t len));
|
||||||
|
|
|
@ -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$ */
|
/* $Id$ */
|
||||||
|
|
||||||
#ifndef __SHA2_H__
|
#ifndef __SHA2_H__
|
||||||
|
@ -74,6 +74,32 @@ typedef struct _SHA512_CTX {
|
||||||
typedef SHA512_CTX SHA384_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 ******************************/
|
/*** SHA-256/384/512 Function Prototypes ******************************/
|
||||||
void SHA256_Init _((SHA256_CTX *));
|
void SHA256_Init _((SHA256_CTX *));
|
||||||
void SHA256_Update _((SHA256_CTX*, const uint8_t*, size_t));
|
void SHA256_Update _((SHA256_CTX*, const uint8_t*, size_t));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче