aboutsummaryrefslogtreecommitdiff
path: root/crypto/tcrypt.h
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2006-08-19 21:38:49 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2006-09-21 11:46:18 +1000
commite9d41164e2fdd897fe4520c2079ea0000f6e0ec3 (patch)
treeda56da7216ac1cc7abc040b93ed6a358d374ef71 /crypto/tcrypt.h
parent0796ae061e6da5de7cfc1af57dfd42a73908b1bf (diff)
[CRYPTO] tcrypt: Use HMAC template and hash interface
This patch converts tcrypt to use the new HMAC template rather than the hard-coded version of HMAC. It also converts all digest users to use the new cipher interface. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'crypto/tcrypt.h')
-rw-r--r--crypto/tcrypt.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h
index 408d5aad586..a40c4411729 100644
--- a/crypto/tcrypt.h
+++ b/crypto/tcrypt.h
@@ -36,16 +36,6 @@ struct hash_testvec {
unsigned char ksize;
};
-struct hmac_testvec {
- char key[128];
- char plaintext[128];
- char digest[MAX_DIGEST_SIZE];
- unsigned char tap[MAX_TAP];
- unsigned char ksize;
- unsigned char psize;
- unsigned char np;
-};
-
struct cipher_testvec {
char key[MAX_KEYLEN] __attribute__ ((__aligned__(4)));
char iv[MAX_IVLEN];
@@ -65,7 +55,7 @@ struct cipher_speed {
unsigned int blen;
};
-struct digest_speed {
+struct hash_speed {
unsigned int blen; /* buffer length */
unsigned int plen; /* per-update length */
};
@@ -697,14 +687,13 @@ static struct hash_testvec tgr128_tv_template[] = {
},
};
-#ifdef CONFIG_CRYPTO_HMAC
/*
* HMAC-MD5 test vectors from RFC2202
* (These need to be fixed to not use strlen).
*/
#define HMAC_MD5_TEST_VECTORS 7
-static struct hmac_testvec hmac_md5_tv_template[] =
+static struct hash_testvec hmac_md5_tv_template[] =
{
{
.key = { [0 ... 15] = 0x0b },
@@ -768,7 +757,7 @@ static struct hmac_testvec hmac_md5_tv_template[] =
*/
#define HMAC_SHA1_TEST_VECTORS 7
-static struct hmac_testvec hmac_sha1_tv_template[] = {
+static struct hash_testvec hmac_sha1_tv_template[] = {
{
.key = { [0 ... 19] = 0x0b },
.ksize = 20,
@@ -833,7 +822,7 @@ static struct hmac_testvec hmac_sha1_tv_template[] = {
*/
#define HMAC_SHA256_TEST_VECTORS 10
-static struct hmac_testvec hmac_sha256_tv_template[] = {
+static struct hash_testvec hmac_sha256_tv_template[] = {
{
.key = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
@@ -944,8 +933,6 @@ static struct hmac_testvec hmac_sha256_tv_template[] = {
},
};
-#endif /* CONFIG_CRYPTO_HMAC */
-
/*
* DES test vectors.
*/
@@ -3160,7 +3147,7 @@ static struct cipher_speed des_speed_template[] = {
/*
* Digest speed tests
*/
-static struct digest_speed generic_digest_speed_template[] = {
+static struct hash_speed generic_hash_speed_template[] = {
{ .blen = 16, .plen = 16, },
{ .blen = 64, .plen = 16, },
{ .blen = 64, .plen = 64, },