X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmd5.h;h=fda0ba4edae8c84b60d6062a80a0bba5e43050c7;hb=15d3d56a7b7603e5ed4056ca2fce9d923a6649b6;hp=e8ee9dc0184cc138b2540233c4d0413f3ef033af;hpb=8ca2e4a7769b6e5fd2c5215c25877916e499cad6;p=gnulib.git diff --git a/lib/md5.h b/lib/md5.h index e8ee9dc01..fda0ba4ed 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -1,22 +1,22 @@ /* md5.h - Declaration of functions and data types used for MD5 sum computing library functions. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - This file is part of the GNU C Library. + Copyright (C) 1995, 1996, 1999, 2000, 2003 Free Software Foundation, Inc. + NOTE: The canonical source of this file is maintained with the GNU C + Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. - The GNU C Library is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with the GNU C Library; see the file COPYING.LIB. If not, - write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MD5_H #define _MD5_H 1 @@ -35,8 +35,9 @@ is usually not possible. */ #ifdef _LIBC -# include -typedef u_int32_t md5_uint32; +# include +typedef uint32_t md5_uint32; +typedef uintptr_t md5_uintptr; #else # if defined __STDC__ && __STDC__ # define UINT_MAX_32_BITS 4294967295U @@ -68,6 +69,9 @@ typedef u_int32_t md5_uint32; # endif # endif # endif +/* We have to make a guess about the integer type equivalent in size + to pointers which should always be correct. */ +typedef unsigned long int md5_uintptr; #endif #undef __P @@ -118,7 +122,7 @@ extern void md5_process_bytes __P ((const void *buffer, size_t len, endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. - IMPORTANT: On some systems it is required that RESBUF is correctly + IMPORTANT: On some systems it is required that RESBUF be correctly aligned for a 32 bits value. */ extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); @@ -143,4 +147,19 @@ extern int md5_stream __P ((FILE *stream, void *resblock)); digest. */ extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); +/* The following is from gnupg-1.0.2's cipher/bithelp.h. */ +/* Rotate a 32 bit integer by n bytes */ +#if defined __GNUC__ && defined __i386__ +static inline md5_uint32 +rol(md5_uint32 x, int n) +{ + __asm__("roll %%cl,%0" + :"=r" (x) + :"0" (x),"c" (n)); + return x; +} +#else +# define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) +#endif + #endif