X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fmd32_common.h;h=a5b838442b398eb32ac7b901736fe50c850844de;hb=fcb76baeb04bb961e8bbc44b81ecdfc2f27dddf4;hp=2b91f9eef2a59dd8b31f87d52f75601d3df71749;hpb=946cbf67afc5a76394008bcad9efa67deeefb172;p=oweals%2Fopenssl.git diff --git a/crypto/md32_common.h b/crypto/md32_common.h index 2b91f9eef2..a5b838442b 100644 --- a/crypto/md32_common.h +++ b/crypto/md32_common.h @@ -94,6 +94,8 @@ * in original (data) byte order, implemented externally (it * actually is optional if data and host are of the same * "endianess"). + * HASH_MAKE_STRING + * macro convering context variables to an ASCII hash string. * * Optional macros: * @@ -178,7 +180,16 @@ #undef ROTATE #ifndef PEDANTIC # if defined(_MSC_VER) -# define ROTATE(a,n) _lrotl(a,n) +# define ROTATE(a,n) _lrotl(a,n) +# elif defined(__MWERKS__) +# if defined(__POWERPC__) +# define ROTATE(a,n) __rlwinm(a,n,0,31) +# elif defined(__MC68K__) + /* Motorola specific tweak. */ +# define ROTATE(a,n) ( n<24 ? __rol(a,n) : __ror(a,32-n) ) +# else +# define ROTATE(a,n) __rol(a,n) +# endif # elif defined(__GNUC__) && __GNUC__>=2 && !defined(NO_ASM) /* * Some GNU C inline assembler templates. Note that these are @@ -581,10 +592,11 @@ void HASH_FINAL (unsigned char *md, HASH_CTX *c) #endif HASH_BLOCK_HOST_ORDER (c,p,1); - l=c->A; HOST_l2c(l,md); - l=c->B; HOST_l2c(l,md); - l=c->C; HOST_l2c(l,md); - l=c->D; HOST_l2c(l,md); +#ifndef HASH_MAKE_STRING +#error "HASH_MAKE_STRING must be defined!" +#else + HASH_MAKE_STRING(c,md); +#endif c->num=0; /* clear stuff, HASH_BLOCK may be leaving some stuff on the stack