summaryrefslogtreecommitdiff
path: root/cipher/sha256.c
diff options
context:
space:
mode:
authorMoritz Schulte <mo@g10code.com>2003-02-28 01:41:14 +0000
committerMoritz Schulte <mo@g10code.com>2003-02-28 01:41:14 +0000
commit622a9c5c3e7aaf1bb0296ca1d072cc57e8469135 (patch)
tree38a32381045549142f6d0b92566dd4d4581a2f24 /cipher/sha256.c
parent8ccfdc7879b49e1e5e7f71133d208659b6177690 (diff)
downloadlibgcrypt-622a9c5c3e7aaf1bb0296ca1d072cc57e8469135.tar.gz
2003-02-23 Moritz Schulte <moritz@g10code.com>
* cipher.c: Remove (bogus) `digitp' macro definition. * md.c: Likewise. * blowfish.c (burn_stack): Removed. * arcfour.c (burn_stack): Likewise. * cast5.c (burn_stack): Likewise. * des.c (burn_stack): Likewise. * md4.c (burn_stack): Likewise. * md5.c (burn_stack): Likewise. * random.c (burn_stack): Likewise. * rijndael.c (burn_stack): Likewise. * rmd160.c (burn_stack): Likewise. * sha1.c (burn_stack): Likewise. * sha256.c (burn_stack): Likewise. * tiger.c (burn_stack): Likewise. * twofish.c (burn_stack): Likewise. * blowfish.c: Changed all occurences of burn_stack to _gcry_burn_stack. * arcfour.c: Likewise. * cast5.c: Likewise. * des.c: Likewise. * md4.c: Likewise. * md5.c: Likewise. * random.c: Likewise. * rijndael.c: Likewise. * rmd160.c: Likewise. * sha1.c: Likewise. * sha256.c: Likewise. * tiger.c: Likewise. * twofish.c: Likewise. * arcfour.c (_gcry_arcfour_get_info): Use GCRY_CIPHER_ARCFOUR instead of hard-coded value `301'.
Diffstat (limited to 'cipher/sha256.c')
-rw-r--r--cipher/sha256.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/cipher/sha256.c b/cipher/sha256.c
index 9eb2bbe2..1aafd334 100644
--- a/cipher/sha256.c
+++ b/cipher/sha256.c
@@ -53,18 +53,6 @@ typedef struct {
static void
-burn_stack (int bytes)
-{
- char buf[128];
-
- memset (buf, 0, sizeof buf);
- bytes -= sizeof buf;
- if (bytes > 0)
- burn_stack (bytes);
-}
-
-
-static void
sha256_init (SHA256_CONTEXT *hd)
{
hd->h0 = 0x6a09e667;
@@ -190,7 +178,7 @@ sha256_write (SHA256_CONTEXT *hd, byte *inbuf, size_t inlen)
if (hd->count == 64)
{ /* flush the buffer */
transform (hd, hd->buf);
- burn_stack (74*4+32);
+ _gcry_burn_stack (74*4+32);
hd->count = 0;
hd->nblocks++;
}
@@ -213,7 +201,7 @@ sha256_write (SHA256_CONTEXT *hd, byte *inbuf, size_t inlen)
inlen -= 64;
inbuf += 64;
}
- burn_stack (74*4+32);
+ _gcry_burn_stack (74*4+32);
for (; inlen && hd->count < 64; inlen--)
hd->buf[hd->count++] = *inbuf++;
}
@@ -270,7 +258,7 @@ sha256_final(SHA256_CONTEXT *hd)
hd->buf[62] = lsb >> 8;
hd->buf[63] = lsb;
transform (hd, hd->buf);
- burn_stack (74*4+32);
+ _gcry_burn_stack (74*4+32);
p = hd->buf;
#ifdef BIG_ENDIAN_HOST