diff options
| author | beck <> | 2002-05-15 02:29:21 +0000 |
|---|---|---|
| committer | beck <> | 2002-05-15 02:29:21 +0000 |
| commit | b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9 (patch) | |
| tree | fa27cf82a1250b64ed3bf5f4a18c7354d470bbcc /src/lib/libcrypto/ripemd | |
| parent | e471e1ea98d673597b182ea85f29e30c97cd08b5 (diff) | |
| download | openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.gz openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.tar.bz2 openbsd-b64270d1e45fe7f3241e4c9b6ce60d5ac89bc2e9.zip | |
OpenSSL 0.9.7 stable 2002 05 08 merge
Diffstat (limited to 'src/lib/libcrypto/ripemd')
| -rw-r--r-- | src/lib/libcrypto/ripemd/Makefile.ssl | 13 | ||||
| -rw-r--r-- | src/lib/libcrypto/ripemd/ripemd.h | 14 | ||||
| -rw-r--r-- | src/lib/libcrypto/ripemd/rmd_dgst.c | 3 | ||||
| -rw-r--r-- | src/lib/libcrypto/ripemd/rmd_locl.h | 4 | ||||
| -rw-r--r-- | src/lib/libcrypto/ripemd/rmdtest.c | 9 |
5 files changed, 25 insertions, 18 deletions
diff --git a/src/lib/libcrypto/ripemd/Makefile.ssl b/src/lib/libcrypto/ripemd/Makefile.ssl index 1550c32ca1..a3a6563a5b 100644 --- a/src/lib/libcrypto/ripemd/Makefile.ssl +++ b/src/lib/libcrypto/ripemd/Makefile.ssl | |||
| @@ -12,7 +12,8 @@ INSTALL_PREFIX= | |||
| 12 | OPENSSLDIR= /usr/local/ssl | 12 | OPENSSLDIR= /usr/local/ssl |
| 13 | INSTALLTOP=/usr/local/ssl | 13 | INSTALLTOP=/usr/local/ssl |
| 14 | MAKE= make -f Makefile.ssl | 14 | MAKE= make -f Makefile.ssl |
| 15 | MAKEDEPEND= $(TOP)/util/domd $(TOP) | 15 | MAKEDEPPROG= makedepend |
| 16 | MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG) | ||
| 16 | MAKEFILE= Makefile.ssl | 17 | MAKEFILE= Makefile.ssl |
| 17 | AR= ar r | 18 | AR= ar r |
| 18 | 19 | ||
| @@ -42,8 +43,7 @@ all: lib | |||
| 42 | 43 | ||
| 43 | lib: $(LIBOBJ) | 44 | lib: $(LIBOBJ) |
| 44 | $(AR) $(LIB) $(LIBOBJ) | 45 | $(AR) $(LIB) $(LIBOBJ) |
| 45 | @echo You may get an error following this line. Please ignore. | 46 | $(RANLIB) $(LIB) || echo Never mind. |
| 46 | - $(RANLIB) $(LIB) | ||
| 47 | @touch lib | 47 | @touch lib |
| 48 | 48 | ||
| 49 | # elf | 49 | # elf |
| @@ -103,7 +103,8 @@ clean: | |||
| 103 | 103 | ||
| 104 | # DO NOT DELETE THIS LINE -- make depend depends on it. | 104 | # DO NOT DELETE THIS LINE -- make depend depends on it. |
| 105 | 105 | ||
| 106 | rmd_dgst.o: ../../include/openssl/opensslconf.h | 106 | rmd_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 107 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ripemd.h | 107 | rmd_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/ripemd.h |
| 108 | rmd_dgst.o: ../md32_common.h rmd_locl.h rmdconst.h | 108 | rmd_dgst.o: ../md32_common.h rmd_dgst.c rmd_locl.h rmdconst.h |
| 109 | rmd_one.o: ../../include/openssl/ripemd.h | 109 | rmd_one.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h |
| 110 | rmd_one.o: ../../include/openssl/ripemd.h rmd_one.c | ||
diff --git a/src/lib/libcrypto/ripemd/ripemd.h b/src/lib/libcrypto/ripemd/ripemd.h index dd1627cf40..78d5f36560 100644 --- a/src/lib/libcrypto/ripemd/ripemd.h +++ b/src/lib/libcrypto/ripemd/ripemd.h | |||
| @@ -59,17 +59,19 @@ | |||
| 59 | #ifndef HEADER_RIPEMD_H | 59 | #ifndef HEADER_RIPEMD_H |
| 60 | #define HEADER_RIPEMD_H | 60 | #define HEADER_RIPEMD_H |
| 61 | 61 | ||
| 62 | #include <openssl/e_os2.h> | ||
| 63 | |||
| 62 | #ifdef __cplusplus | 64 | #ifdef __cplusplus |
| 63 | extern "C" { | 65 | extern "C" { |
| 64 | #endif | 66 | #endif |
| 65 | 67 | ||
| 66 | #ifdef NO_RIPEMD | 68 | #ifdef OPENSSL_NO_RIPEMD |
| 67 | #error RIPEMD is disabled. | 69 | #error RIPEMD is disabled. |
| 68 | #endif | 70 | #endif |
| 69 | 71 | ||
| 70 | #if defined(WIN16) || defined(__LP32__) | 72 | #if defined(OPENSSL_SYS_WIN16) || defined(__LP32__) |
| 71 | #define RIPEMD160_LONG unsigned long | 73 | #define RIPEMD160_LONG unsigned long |
| 72 | #elif defined(_CRAY) || defined(__ILP64__) | 74 | #elif defined(OPENSSL_SYS_CRAY) || defined(__ILP64__) |
| 73 | #define RIPEMD160_LONG unsigned long | 75 | #define RIPEMD160_LONG unsigned long |
| 74 | #define RIPEMD160_LONG_LOG2 3 | 76 | #define RIPEMD160_LONG_LOG2 3 |
| 75 | #else | 77 | #else |
| @@ -88,9 +90,9 @@ typedef struct RIPEMD160state_st | |||
| 88 | int num; | 90 | int num; |
| 89 | } RIPEMD160_CTX; | 91 | } RIPEMD160_CTX; |
| 90 | 92 | ||
| 91 | void RIPEMD160_Init(RIPEMD160_CTX *c); | 93 | int RIPEMD160_Init(RIPEMD160_CTX *c); |
| 92 | void RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, unsigned long len); | 94 | int RIPEMD160_Update(RIPEMD160_CTX *c, const void *data, unsigned long len); |
| 93 | void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); | 95 | int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); |
| 94 | unsigned char *RIPEMD160(const unsigned char *d, unsigned long n, | 96 | unsigned char *RIPEMD160(const unsigned char *d, unsigned long n, |
| 95 | unsigned char *md); | 97 | unsigned char *md); |
| 96 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); | 98 | void RIPEMD160_Transform(RIPEMD160_CTX *c, const unsigned char *b); |
diff --git a/src/lib/libcrypto/ripemd/rmd_dgst.c b/src/lib/libcrypto/ripemd/rmd_dgst.c index bdfae270b6..a3170f7c8a 100644 --- a/src/lib/libcrypto/ripemd/rmd_dgst.c +++ b/src/lib/libcrypto/ripemd/rmd_dgst.c | |||
| @@ -69,7 +69,7 @@ const char *RMD160_version="RIPE-MD160" OPENSSL_VERSION_PTEXT; | |||
| 69 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p,int num); | 69 | void ripemd160_block(RIPEMD160_CTX *c, unsigned long *p,int num); |
| 70 | # endif | 70 | # endif |
| 71 | 71 | ||
| 72 | void RIPEMD160_Init(RIPEMD160_CTX *c) | 72 | int RIPEMD160_Init(RIPEMD160_CTX *c) |
| 73 | { | 73 | { |
| 74 | c->A=RIPEMD160_A; | 74 | c->A=RIPEMD160_A; |
| 75 | c->B=RIPEMD160_B; | 75 | c->B=RIPEMD160_B; |
| @@ -79,6 +79,7 @@ void RIPEMD160_Init(RIPEMD160_CTX *c) | |||
| 79 | c->Nl=0; | 79 | c->Nl=0; |
| 80 | c->Nh=0; | 80 | c->Nh=0; |
| 81 | c->num=0; | 81 | c->num=0; |
| 82 | return 1; | ||
| 82 | } | 83 | } |
| 83 | 84 | ||
| 84 | #ifndef ripemd160_block_host_order | 85 | #ifndef ripemd160_block_host_order |
diff --git a/src/lib/libcrypto/ripemd/rmd_locl.h b/src/lib/libcrypto/ripemd/rmd_locl.h index f537b88867..7b835dfbd4 100644 --- a/src/lib/libcrypto/ripemd/rmd_locl.h +++ b/src/lib/libcrypto/ripemd/rmd_locl.h | |||
| @@ -71,7 +71,7 @@ | |||
| 71 | * <appro@fy.chalmers.se> | 71 | * <appro@fy.chalmers.se> |
| 72 | */ | 72 | */ |
| 73 | #ifdef RMD160_ASM | 73 | #ifdef RMD160_ASM |
| 74 | # if defined(__i386) || defined(_M_IX86) || defined(__INTEL__) | 74 | # if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) |
| 75 | # define ripemd160_block_host_order ripemd160_block_asm_host_order | 75 | # define ripemd160_block_host_order ripemd160_block_asm_host_order |
| 76 | # endif | 76 | # endif |
| 77 | #endif | 77 | #endif |
| @@ -79,7 +79,7 @@ | |||
| 79 | void ripemd160_block_host_order (RIPEMD160_CTX *c, const void *p,int num); | 79 | void ripemd160_block_host_order (RIPEMD160_CTX *c, const void *p,int num); |
| 80 | void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,int num); | 80 | void ripemd160_block_data_order (RIPEMD160_CTX *c, const void *p,int num); |
| 81 | 81 | ||
| 82 | #if defined(__i386) || defined(_M_IX86) || defined(__INTEL__) | 82 | #if defined(__i386) || defined(__i386__) || defined(_M_IX86) || defined(__INTEL__) |
| 83 | #define ripemd160_block_data_order ripemd160_block_host_order | 83 | #define ripemd160_block_data_order ripemd160_block_host_order |
| 84 | #endif | 84 | #endif |
| 85 | 85 | ||
diff --git a/src/lib/libcrypto/ripemd/rmdtest.c b/src/lib/libcrypto/ripemd/rmdtest.c index 5d79c99725..19e9741db2 100644 --- a/src/lib/libcrypto/ripemd/rmdtest.c +++ b/src/lib/libcrypto/ripemd/rmdtest.c | |||
| @@ -59,15 +59,16 @@ | |||
| 59 | #include <stdio.h> | 59 | #include <stdio.h> |
| 60 | #include <string.h> | 60 | #include <string.h> |
| 61 | #include <stdlib.h> | 61 | #include <stdlib.h> |
| 62 | #include <openssl/ripemd.h> | ||
| 62 | 63 | ||
| 63 | #ifdef NO_RIPEMD | 64 | #ifdef OPENSSL_NO_RIPEMD |
| 64 | int main(int argc, char *argv[]) | 65 | int main(int argc, char *argv[]) |
| 65 | { | 66 | { |
| 66 | printf("No ripemd support\n"); | 67 | printf("No ripemd support\n"); |
| 67 | return(0); | 68 | return(0); |
| 68 | } | 69 | } |
| 69 | #else | 70 | #else |
| 70 | #include <openssl/ripemd.h> | 71 | #include <openssl/evp.h> |
| 71 | 72 | ||
| 72 | #ifdef CHARSET_EBCDIC | 73 | #ifdef CHARSET_EBCDIC |
| 73 | #include <openssl/ebcdic.h> | 74 | #include <openssl/ebcdic.h> |
| @@ -102,6 +103,7 @@ int main(int argc, char *argv[]) | |||
| 102 | int i,err=0; | 103 | int i,err=0; |
| 103 | unsigned char **P,**R; | 104 | unsigned char **P,**R; |
| 104 | char *p; | 105 | char *p; |
| 106 | unsigned char md[RIPEMD160_DIGEST_LENGTH]; | ||
| 105 | 107 | ||
| 106 | P=(unsigned char **)test; | 108 | P=(unsigned char **)test; |
| 107 | R=(unsigned char **)ret; | 109 | R=(unsigned char **)ret; |
| @@ -111,7 +113,8 @@ int main(int argc, char *argv[]) | |||
| 111 | #ifdef CHARSET_EBCDIC | 113 | #ifdef CHARSET_EBCDIC |
| 112 | ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P)); | 114 | ebcdic2ascii((char *)*P, (char *)*P, strlen((char *)*P)); |
| 113 | #endif | 115 | #endif |
| 114 | p=pt(RIPEMD160(&(P[0][0]),(unsigned long)strlen((char *)*P),NULL)); | 116 | EVP_Digest(&(P[0][0]),(unsigned long)strlen((char *)*P),md,NULL,EVP_ripemd160(), NULL); |
| 117 | p=pt(md); | ||
| 115 | if (strcmp(p,(char *)*R) != 0) | 118 | if (strcmp(p,(char *)*R) != 0) |
| 116 | { | 119 | { |
| 117 | printf("error calculating RIPEMD160 on '%s'\n",*P); | 120 | printf("error calculating RIPEMD160 on '%s'\n",*P); |
