You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
crypto: vmac - New hash algorithm for intel_txt support
This patch adds VMAC (a fast MAC) support into crypto framework. Signed-off-by: Shane Wang <shane.wang@intel.com> Signed-off-by: Joseph Cihula <joseph.cihula@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
+678
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user