summaryrefslogtreecommitdiff
path: root/cipher/mac-hmac.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-08-19 17:31:19 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2021-08-19 17:31:19 +0900
commitc9acca865ba4abaa4443712f87fb8926fe7ad8b7 (patch)
tree790f2394050f6d33fba8be0d3874dd5e21d8e508 /cipher/mac-hmac.c
parentc11788e5641be26371adc90f63e5a191cfc796f8 (diff)
downloadlibgcrypt-c9acca865ba4abaa4443712f87fb8926fe7ad8b7.tar.gz
hmac: Don't have the second implementation of hmac256.
* src/Makefile.am (libgcrypt_la_SOURCES): Remove hmac256. * cipher/mac-hmac.c (selftests_sha256): Remove the tests. -- GnuPG-bug-id: 5550 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/mac-hmac.c')
-rw-r--r--cipher/mac-hmac.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/cipher/mac-hmac.c b/cipher/mac-hmac.c
index 4e10dd2c..6d76895a 100644
--- a/cipher/mac-hmac.c
+++ b/cipher/mac-hmac.c
@@ -28,7 +28,6 @@
#include "./mac-internal.h"
#include "bufhelp.h"
#include "cipher.h"
-#include "hmac256.h"
static int
@@ -559,10 +558,6 @@ selftests_sha256 (int extended, selftest_report_func_t report)
for (tvidx=0; tv[tvidx].desc; tvidx++)
{
- hmac256_context_t hmachd;
- const unsigned char *digest;
- size_t dlen;
-
what = tv[tvidx].desc;
errtxt = check_one (GCRY_MD_SHA256,
tv[tvidx].data, strlen (tv[tvidx].data),
@@ -570,30 +565,6 @@ selftests_sha256 (int extended, selftest_report_func_t report)
tv[tvidx].expect, DIM (tv[tvidx].expect), 0);
if (errtxt)
goto failed;
-
- hmachd = _gcry_hmac256_new (tv[tvidx].key, strlen (tv[tvidx].key));
- if (!hmachd)
- {
- errtxt = "_gcry_hmac256_new failed";
- goto failed;
- }
- _gcry_hmac256_update (hmachd, tv[tvidx].data, strlen (tv[tvidx].data));
- digest = _gcry_hmac256_finalize (hmachd, &dlen);
- if (!digest)
- {
- errtxt = "_gcry_hmac256_finalize failed";
- _gcry_hmac256_release (hmachd);
- goto failed;
- }
- if (dlen != DIM (tv[tvidx].expect)
- || memcmp (digest, tv[tvidx].expect, DIM (tv[tvidx].expect)))
- {
- errtxt = "does not match in second implementation";
- _gcry_hmac256_release (hmachd);
- goto failed;
- }
- _gcry_hmac256_release (hmachd);
-
if (!extended)
break;
}