/* Declarations of functions and data types used for SHA512 and SHA384 sum
library functions.
- Copyright (C) 2005 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006 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
# include <stdio.h>
-# if HAVE_INTTYPES_H
-# include <inttypes.h>
-# endif
-# if HAVE_STDINT_H || _LIBC
-# include <stdint.h>
-# endif
-
-typedef uint64_t sha512_uint64;
-
+# include "u64.h"
/* Structure to save state of computation between the single steps. */
struct sha512_ctx
{
- sha512_uint64 state[8];
+ u64 state[8];
- sha512_uint64 total[2];
- sha512_uint64 buflen;
- char buffer[256];
+ u64 total[2];
+ size_t buflen;
+ u64 buffer[32];
};
extern void *sha512_buffer (const char *buffer, size_t len, void *resblock);
extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
-# define rol64(x,n) ( ((x) << (n)) | ((x) >> (64-(n))) )
-
#endif