summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cipher/md.c4
-rw-r--r--cipher/md4.c2
-rw-r--r--cipher/md5.c2
-rw-r--r--cipher/rmd160.c4
-rw-r--r--cipher/sha1.c2
-rw-r--r--cipher/sha256.c2
-rw-r--r--cipher/sha512.c2
-rw-r--r--cipher/tiger.c4
8 files changed, 11 insertions, 11 deletions
diff --git a/cipher/md.c b/cipher/md.c
index df8b027e..f9414def 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -315,7 +315,7 @@ md_open (gcry_md_hd_t *h, int algo, unsigned int flags)
if (! err)
{
- hd->ctx = ctx = (struct gcry_md_context *) ((char *) hd + n);
+ hd->ctx = ctx = (void *) ((char *) hd + n);
/* Setup the globally visible data (bctl in the diagram).*/
hd->bufsize = n - sizeof (struct gcry_md_handle) + 1;
hd->bufpos = 0;
@@ -488,7 +488,7 @@ md_copy (gcry_md_hd_t ahd, gcry_md_hd_t *b_hd)
if (! err)
{
- bhd->ctx = b = (struct gcry_md_context *) ((char *) bhd + n);
+ bhd->ctx = b = (void *) ((char *) bhd + n);
/* No need to copy the buffer due to the write above. */
gcry_assert (ahd->bufsize == (n - sizeof (struct gcry_md_handle) + 1));
bhd->bufsize = ahd->bufsize;
diff --git a/cipher/md4.c b/cipher/md4.c
index 72912545..c9b41542 100644
--- a/cipher/md4.c
+++ b/cipher/md4.c
@@ -255,7 +255,7 @@ md4_final( void *context )
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u32*)p = le_bswap32((*hd).a) ; p += 4; } while(0)
+#define X(a) do { buf_put_le32(p, hd->a); p += 4; } while(0)
X(A);
X(B);
X(C);
diff --git a/cipher/md5.c b/cipher/md5.c
index 73ad968b..f17af7a9 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -279,7 +279,7 @@ md5_final( void *context)
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u32*)p = le_bswap32((*hd).a) ; p += 4; } while(0)
+#define X(a) do { buf_put_le32(p, hd->a); p += 4; } while(0)
X(A);
X(B);
X(C);
diff --git a/cipher/rmd160.c b/cipher/rmd160.c
index e6d02f54..2b1f3213 100644
--- a/cipher/rmd160.c
+++ b/cipher/rmd160.c
@@ -411,7 +411,7 @@ _gcry_rmd160_mixblock ( RMD160_CONTEXT *hd, void *blockof64byte )
char *p = blockof64byte;
transform ( hd, blockof64byte, 1 );
-#define X(a) do { *(u32*)p = hd->h##a ; p += 4; } while(0)
+#define X(a) do { buf_put_le32(p, hd->h##a); p += 4; } while(0)
X(0);
X(1);
X(2);
@@ -474,7 +474,7 @@ rmd160_final( void *context )
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u32*)p = le_bswap32(hd->h##a) ; p += 4; } while(0)
+#define X(a) do { buf_put_le32(p, hd->h##a); p += 4; } while(0)
X(0);
X(1);
X(2);
diff --git a/cipher/sha1.c b/cipher/sha1.c
index 00c57dd4..6ccf0e8e 100644
--- a/cipher/sha1.c
+++ b/cipher/sha1.c
@@ -401,7 +401,7 @@ sha1_final(void *context)
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u32*)p = be_bswap32(hd->h##a) ; p += 4; } while(0)
+#define X(a) do { buf_put_be32(p, hd->h##a); p += 4; } while(0)
X(0);
X(1);
X(2);
diff --git a/cipher/sha256.c b/cipher/sha256.c
index 4efaec6f..d3af1722 100644
--- a/cipher/sha256.c
+++ b/cipher/sha256.c
@@ -428,7 +428,7 @@ sha256_final(void *context)
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u32*)p = be_bswap32(hd->h##a); p += 4; } while(0)
+#define X(a) do { buf_put_be32(p, hd->h##a); p += 4; } while(0)
X(0);
X(1);
X(2);
diff --git a/cipher/sha512.c b/cipher/sha512.c
index 7d60df0f..5a6af808 100644
--- a/cipher/sha512.c
+++ b/cipher/sha512.c
@@ -669,7 +669,7 @@ sha512_final (void *context)
_gcry_burn_stack (stack_burn_depth);
p = hd->bctx.buf;
-#define X(a) do { *(u64*)p = be_bswap64(hd->state.h##a) ; p += 8; } while (0)
+#define X(a) do { buf_put_be64(p, hd->state.h##a); p += 8; } while (0)
X (0);
X (1);
X (2);
diff --git a/cipher/tiger.c b/cipher/tiger.c
index 91db4e66..8a08953e 100644
--- a/cipher/tiger.c
+++ b/cipher/tiger.c
@@ -805,8 +805,8 @@ tiger_final( void *context )
_gcry_burn_stack (burn);
p = hd->bctx.buf;
-#define X(a) do { *(u64*)p = be_bswap64(hd->a); p += 8; } while(0)
-#define Y(a) do { *(u64*)p = le_bswap64(hd->a); p += 8; } while(0)
+#define X(a) do { buf_put_be64(p, hd->a); p += 8; } while(0)
+#define Y(a) do { buf_put_le64(p, hd->a); p += 8; } while(0)
if (hd->variant == 0)
{
X(a);