mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
md32_common.h update and accompanying MD5 update.
This commit is contained in:
parent
87a25f9032
commit
1cbde6e4fa
@ -94,6 +94,8 @@
|
|||||||
* in original (data) byte order, implemented externally (it
|
* in original (data) byte order, implemented externally (it
|
||||||
* actually is optional if data and host are of the same
|
* actually is optional if data and host are of the same
|
||||||
* "endianess").
|
* "endianess").
|
||||||
|
* HASH_MAKE_STRING
|
||||||
|
* macro convering context variables to an ASCII hash string.
|
||||||
*
|
*
|
||||||
* Optional macros:
|
* Optional macros:
|
||||||
*
|
*
|
||||||
@ -178,7 +180,9 @@
|
|||||||
#undef ROTATE
|
#undef ROTATE
|
||||||
#ifndef PEDANTIC
|
#ifndef PEDANTIC
|
||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
# define ROTATE(a,n) _lrotl(a,n)
|
# define ROTATE(a,n) _lrotl(a,n)
|
||||||
|
# elif defined(__MWERKS__)
|
||||||
|
# define ROTATE(a,n) __rol(a,n)
|
||||||
# elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM)
|
# elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM)
|
||||||
/*
|
/*
|
||||||
* Some GNU C inline assembler templates. Note that these are
|
* Some GNU C inline assembler templates. Note that these are
|
||||||
@ -581,10 +585,11 @@ void HASH_FINAL (unsigned char *md, HASH_CTX *c)
|
|||||||
#endif
|
#endif
|
||||||
HASH_BLOCK_HOST_ORDER (c,p,1);
|
HASH_BLOCK_HOST_ORDER (c,p,1);
|
||||||
|
|
||||||
l=c->A; HOST_l2c(l,md);
|
#ifndef HASH_MAKE_STRING
|
||||||
l=c->B; HOST_l2c(l,md);
|
#error "HASH_MAKE_STRING must be defined!"
|
||||||
l=c->C; HOST_l2c(l,md);
|
#else
|
||||||
l=c->D; HOST_l2c(l,md);
|
HASH_MAKE_STRING(c,md);
|
||||||
|
#endif
|
||||||
|
|
||||||
c->num=0;
|
c->num=0;
|
||||||
/* clear stuff, HASH_BLOCK may be leaving some stuff on the stack
|
/* clear stuff, HASH_BLOCK may be leaving some stuff on the stack
|
||||||
|
@ -66,7 +66,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef MD5_ASM
|
#ifdef MD5_ASM
|
||||||
# if defined(__i386) || defined(_M_IX86)
|
# if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
|
||||||
# define md5_block_host_order md5_block_asm_host_order
|
# define md5_block_host_order md5_block_asm_host_order
|
||||||
# elif defined(__sparc) && defined(ULTRASPARC)
|
# elif defined(__sparc) && defined(ULTRASPARC)
|
||||||
void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num);
|
void md5_block_asm_data_order_aligned (MD5_CTX *c, const MD5_LONG *p,int num);
|
||||||
@ -77,7 +77,7 @@
|
|||||||
void md5_block_host_order (MD5_CTX *c, const void *p,int num);
|
void md5_block_host_order (MD5_CTX *c, const void *p,int num);
|
||||||
void md5_block_data_order (MD5_CTX *c, const void *p,int num);
|
void md5_block_data_order (MD5_CTX *c, const void *p,int num);
|
||||||
|
|
||||||
#if defined(__i386) || defined(_M_IX86)
|
#if defined(__i386) || defined(_M_IX86) || defined(__INTEL__)
|
||||||
/*
|
/*
|
||||||
* *_block_host_order is expected to handle aligned data while
|
* *_block_host_order is expected to handle aligned data while
|
||||||
* *_block_data_order - unaligned. As algorithm and host (x86)
|
* *_block_data_order - unaligned. As algorithm and host (x86)
|
||||||
@ -112,6 +112,13 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
|
|||||||
#define HASH_UPDATE MD5_Update
|
#define HASH_UPDATE MD5_Update
|
||||||
#define HASH_TRANSFORM MD5_Transform
|
#define HASH_TRANSFORM MD5_Transform
|
||||||
#define HASH_FINAL MD5_Final
|
#define HASH_FINAL MD5_Final
|
||||||
|
#define HASH_MAKE_STRING(c,s) do { \
|
||||||
|
unsigned long l; \
|
||||||
|
l=(c)->A; HOST_l2c(l,(s)); \
|
||||||
|
l=(c)->B; HOST_l2c(l,(s)); \
|
||||||
|
l=(c)->C; HOST_l2c(l,(s)); \
|
||||||
|
l=(c)->D; HOST_l2c(l,(s)); \
|
||||||
|
} while (0)
|
||||||
#define HASH_BLOCK_HOST_ORDER md5_block_host_order
|
#define HASH_BLOCK_HOST_ORDER md5_block_host_order
|
||||||
#if !defined(L_ENDIAN) || defined(md5_block_data_order)
|
#if !defined(L_ENDIAN) || defined(md5_block_data_order)
|
||||||
#define HASH_BLOCK_DATA_ORDER md5_block_data_order
|
#define HASH_BLOCK_DATA_ORDER md5_block_data_order
|
||||||
|
Loading…
Reference in New Issue
Block a user