mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] sha1: drop never used sha1_hmac
Date: Sat,  8 Oct 2011 16:41:57 +0200	[thread overview]
Message-ID: <1318084919-3984-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1318084919-3984-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 crypto/sha1.c |   39 ---------------------------------------
 1 files changed, 0 insertions(+), 39 deletions(-)

diff --git a/crypto/sha1.c b/crypto/sha1.c
index b4e2abc..e989c8a 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -291,45 +291,6 @@ static void sha1_finish (sha1_context * ctx, uint8_t output[20])
 	PUT_UINT32_BE (ctx->state[4], output, 16);
 }
 
-/*
- * Output = HMAC-SHA-1( input buffer, hmac key )
- */
-void sha1_hmac (uint8_t *key, uint32_t keylen,
-		uint8_t *input, uint32_t ilen, uint8_t output[20])
-{
-	uint32_t i;
-	sha1_context ctx;
-	uint8_t k_ipad[64];
-	uint8_t k_opad[64];
-	uint8_t tmpbuf[20];
-
-	memset (k_ipad, 0x36, 64);
-	memset (k_opad, 0x5C, 64);
-
-	for (i = 0; i < keylen; i++) {
-		if (i >= 64)
-			break;
-
-		k_ipad[i] ^= key[i];
-		k_opad[i] ^= key[i];
-	}
-
-	sha1_starts (&ctx);
-	sha1_update (&ctx, k_ipad, 64);
-	sha1_update (&ctx, input, ilen);
-	sha1_finish (&ctx, tmpbuf);
-
-	sha1_starts (&ctx);
-	sha1_update (&ctx, k_opad, 64);
-	sha1_update (&ctx, tmpbuf, 20);
-	sha1_finish (&ctx, output);
-
-	memset (k_ipad, 0, 64);
-	memset (k_opad, 0, 64);
-	memset (tmpbuf, 0, 20);
-	memset (&ctx, 0, sizeof (sha1_context));
-}
-
 struct sha1 {
 	sha1_context context;
 	struct digest d;
-- 
1.7.6.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2011-10-08 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-08 14:41 [PATCH 1/5] move digest to crypto/ Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:41 ` [PATCH 2/5] digest: factorise file digest to common/digest.c Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:41 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-10-09  9:38   ` [PATCH 3/5] sha1: drop never used sha1_hmac Sascha Hauer
2011-10-10 18:10     ` Jean-Christophe PLAGNIOL-VILLARD
2011-10-12  6:53       ` Sascha Hauer
2011-10-08 14:41 ` [PATCH 4/5] crypto: add sha224 support Jean-Christophe PLAGNIOL-VILLARD
2011-10-08 14:41 ` [PATCH 5/5] command/digest: " Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1318084919-3984-3-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox