/* Functions to compute MD4 message digest of files or memory blocks.
according to the definition of MD4 in RFC 1320 from April 1992.
- Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2005, 2006,
- 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-1997, 1999-2003, 2005-2006, 2008-2012 Free Software
+ Foundation, Inc.
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
GNU General Public License for more details.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ along with this program; if not, see <http://www.gnu.org/licenses/>. */
/* Adapted by Simon Josefsson from gnulib md5.? and Libgcrypt
cipher/md4.c . */
#include "md4.h"
-#include <stddef.h>
-#include <stdlib.h>
+#include <stdalign.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
if (len >= 64)
{
#if !_STRING_ARCH_unaligned
- /* To check alignment gcc has an appropriate operator. Other
- compilers don't. */
-# if __GNUC__ >= 2
-# define UNALIGNED_P(p) (((uintptr_t) p) % __alignof__ (uint32_t) != 0)
-# else
-# define alignof(type) offsetof (struct { char c; type x; }, x)
-# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
-# endif
+# define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
if (UNALIGNED_P (buffer))
while (len > 64)
{