summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2019-04-05 18:48:13 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2019-04-05 18:52:49 +0300
commitc6055aaccac86e1ca8a9d35c980d7abbacf2a9ff (patch)
tree96425c69db03506f9fcde11b90e711fb17ec4b14
parente76cd0e2b1f6025c1319576a5848815d1d231aeb (diff)
downloadlibgcrypt-c6055aaccac86e1ca8a9d35c980d7abbacf2a9ff.tar.gz
Remove extra buffer flush at begining of digest final functions
* cipher/md2.c (md2_final): Remove _gcry_md_block_write flush call from entry. * cipher/md4.c (md4_final): Ditto. * cipher/md5.c (md5_final): Ditto. * cipher/rmd160.c (rmd160_final): Ditto. * cipher/sha1.c (sha1_final): Ditto. * cipher/sha256.c (sha256_final): Ditto. * cipher/sha512.c (sha512_final): Ditto. * cipher/sm3.c (sm3_final): Ditto. * cipher/stribog.c (stribog_final): Ditto. * cipher/tiger.c (tiger_final): Ditto. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r--cipher/md2.c2
-rw-r--r--cipher/md4.c2
-rw-r--r--cipher/md5.c2
-rw-r--r--cipher/rmd160.c2
-rw-r--r--cipher/sha1.c4
-rw-r--r--cipher/sha256.c2
-rw-r--r--cipher/sha512.c2
-rw-r--r--cipher/sm3.c2
-rw-r--r--cipher/stribog.c1
-rw-r--r--cipher/tiger.c2
10 files changed, 1 insertions, 20 deletions
diff --git a/cipher/md2.c b/cipher/md2.c
index b6f7e94f..bf2fbee4 100644
--- a/cipher/md2.c
+++ b/cipher/md2.c
@@ -146,8 +146,6 @@ md2_final (void *context)
MD2_CONTEXT *hd = context;
unsigned int burn;
- _gcry_md_block_write(hd, NULL, 0); /* flush */;
-
/* pad */
memset (hd->bctx.buf + hd->bctx.count,
16 - hd->bctx.count, 16 - hd->bctx.count);
diff --git a/cipher/md4.c b/cipher/md4.c
index 997dbe0c..f6258893 100644
--- a/cipher/md4.c
+++ b/cipher/md4.c
@@ -213,8 +213,6 @@ md4_final( void *context )
byte *p;
unsigned int burn;
- _gcry_md_block_write(hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
diff --git a/cipher/md5.c b/cipher/md5.c
index c432502f..67511ba0 100644
--- a/cipher/md5.c
+++ b/cipher/md5.c
@@ -237,8 +237,6 @@ md5_final( void *context)
byte *p;
unsigned int burn;
- _gcry_md_block_write(hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
diff --git a/cipher/rmd160.c b/cipher/rmd160.c
index 231640d2..f15eec22 100644
--- a/cipher/rmd160.c
+++ b/cipher/rmd160.c
@@ -410,8 +410,6 @@ rmd160_final( void *context )
byte *p;
unsigned int burn;
- _gcry_md_block_write(hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
diff --git a/cipher/sha1.c b/cipher/sha1.c
index affabfb0..23aceef3 100644
--- a/cipher/sha1.c
+++ b/cipher/sha1.c
@@ -511,8 +511,6 @@ sha1_final(void *context)
unsigned char *p;
unsigned int burn;
- _gcry_md_block_write (hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
@@ -532,7 +530,7 @@ sha1_final(void *context)
msb <<= 3;
msb |= t >> 29;
- if( hd->bctx.count < 56 ) /* enough room */
+ if (hd->bctx.count < 56) /* enough room */
{
hd->bctx.buf[hd->bctx.count++] = 0x80; /* pad */
if (hd->bctx.count < 56)
diff --git a/cipher/sha256.c b/cipher/sha256.c
index 327e1029..6c683348 100644
--- a/cipher/sha256.c
+++ b/cipher/sha256.c
@@ -477,8 +477,6 @@ sha256_final(void *context)
byte *p;
unsigned int burn;
- _gcry_md_block_write (hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
diff --git a/cipher/sha512.c b/cipher/sha512.c
index 615b5535..59e65f07 100644
--- a/cipher/sha512.c
+++ b/cipher/sha512.c
@@ -635,8 +635,6 @@ sha512_final (void *context)
u64 t, th, msb, lsb;
byte *p;
- _gcry_md_block_write (context, NULL, 0); /* flush */ ;
-
t = hd->bctx.nblocks;
/* if (sizeof t == sizeof hd->bctx.nblocks) */
th = hd->bctx.nblocks_high;
diff --git a/cipher/sm3.c b/cipher/sm3.c
index 7bfb37b9..e76f3229 100644
--- a/cipher/sm3.c
+++ b/cipher/sm3.c
@@ -270,8 +270,6 @@ sm3_final(void *context)
byte *p;
unsigned int burn;
- _gcry_md_block_write (hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;
diff --git a/cipher/stribog.c b/cipher/stribog.c
index d31dddd3..3eb07735 100644
--- a/cipher/stribog.c
+++ b/cipher/stribog.c
@@ -1287,7 +1287,6 @@ stribog_final (void *context)
u64 Z[8] = {};
int i;
- _gcry_md_block_write (context, NULL, 0); /* flush */ ;
/* PAD. It does not count towards message length */
i = hd->bctx.count;
/* After flush we have at least one byte free) */
diff --git a/cipher/tiger.c b/cipher/tiger.c
index 0319b711..c78e3ac3 100644
--- a/cipher/tiger.c
+++ b/cipher/tiger.c
@@ -736,8 +736,6 @@ tiger_final( void *context )
unsigned int burn;
byte pad = hd->variant == 2? 0x80 : 0x01;
- _gcry_md_block_write(hd, NULL, 0); /* flush */;
-
t = hd->bctx.nblocks;
if (sizeof t == sizeof hd->bctx.nblocks)
th = hd->bctx.nblocks_high;