From 5b3034b74ccb06ce4ee0ff213a1c1d13e4295a7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se>
Date: Sun, 2 Oct 2005 22:53:57 +0200
Subject: [PATCH] (_nettle_sha1_compress): Updated to new interface. Now
 responsible for byte conversion.

Rev: src/nettle/sha1-compress.c:1.2
---
 sha1-compress.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/sha1-compress.c b/sha1-compress.c
index 83ba7aad..b8ee02fe 100644
--- a/sha1-compress.c
+++ b/sha1-compress.c
@@ -110,14 +110,19 @@
 /* Perform the SHA transformation.  Note that this code, like MD5, seems to
    break some optimizing compilers due to the complexity of the expressions
    and the size of the basic block.  It may be necessary to split it into
-   sections, e.g. based on the four subrounds
-
-   Note that this function destroys the data area */
+   sections, e.g. based on the four subrounds. */
 
 void
-_nettle_sha1_compress(uint32_t *state, uint32_t *data)
+_nettle_sha1_compress(uint32_t *state, const uint8_t *input)
 {
+  uint32_t data[16];
   uint32_t A, B, C, D, E;     /* Local vars */
+  int i;
+
+  for (i = 0; i < 16; i++, input+= 4)
+    {
+      data[i] = READ_UINT32(input);
+    }
 
   /* Set up first buffer and local data buffer */
   A = state[0];
-- 
GitLab