Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1939f7c authored by Shane Wang's avatar Shane Wang Committed by Herbert Xu
Browse files

crypto: vmac - New hash algorithm for intel_txt support



This patch adds VMAC (a fast MAC) support into crypto framework.

Signed-off-by: default avatarShane Wang <shane.wang@intel.com>
Signed-off-by: default avatarJoseph Cihula <joseph.cihula@intel.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2bf29016
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -269,6 +269,18 @@ config CRYPTO_XCBC
		http://csrc.nist.gov/encryption/modes/proposedmodes/
		 xcbc-mac/xcbc-mac-spec.pdf

config CRYPTO_VMAC
	tristate "VMAC support"
	depends on EXPERIMENTAL
	select CRYPTO_HASH
	select CRYPTO_MANAGER
	help
	  VMAC is a message authentication algorithm designed for
	  very high speed on 64-bit architectures.

	  See also:
	  <http://fastcrypto.org/vmac>

comment "Digest"

config CRYPTO_CRC32C
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ cryptomgr-objs := algboss.o testmgr.o

obj-$(CONFIG_CRYPTO_MANAGER2) += cryptomgr.o
obj-$(CONFIG_CRYPTO_HMAC) += hmac.o
obj-$(CONFIG_CRYPTO_VMAC) += vmac.o
obj-$(CONFIG_CRYPTO_XCBC) += xcbc.o
obj-$(CONFIG_CRYPTO_NULL) += crypto_null.o
obj-$(CONFIG_CRYPTO_MD4) += md4.o
+4 −0
Original line number Diff line number Diff line
@@ -719,6 +719,10 @@ static int do_test(int m)
		ret += tcrypt_test("hmac(rmd160)");
		break;

	case 109:
		ret += tcrypt_test("vmac(aes)");
		break;

	case 150:
		ret += tcrypt_test("ansi_cprng");
		break;
+9 −0
Original line number Diff line number Diff line
@@ -2247,6 +2247,15 @@ static const struct alg_test_desc alg_test_descs[] = {
				.count = TGR192_TEST_VECTORS
			}
		}
	}, {
		.alg = "vmac(aes)",
		.test = alg_test_hash,
		.suite = {
			.hash = {
				.vecs = aes_vmac128_tv_template,
				.count = VMAC_AES_TEST_VECTORS
			}
		}
	}, {
		.alg = "wp256",
		.test = alg_test_hash,
+16 −0
Original line number Diff line number Diff line
@@ -1654,6 +1654,22 @@ static struct hash_testvec aes_xcbc128_tv_template[] = {
	}
};

#define VMAC_AES_TEST_VECTORS	1
static char vmac_string[128] = {'\x01', '\x01', '\x01', '\x01',
				'\x02', '\x03', '\x02', '\x02',
				'\x02', '\x04', '\x01', '\x07',
				'\x04', '\x01', '\x04', '\x03',};
static struct hash_testvec aes_vmac128_tv_template[] = {
	{
		.key    = "\x00\x01\x02\x03\x04\x05\x06\x07"
			  "\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f",
		.plaintext = vmac_string,
		.digest = "\xcb\xd7\x8a\xfd\xb7\x33\x79\xe7",
		.psize  = 128,
		.ksize  = 16,
	},
};

/*
 * SHA384 HMAC test vectors from RFC4231
 */
Loading