summaryrefslogtreecommitdiff
path: root/crypto/testmgr.c
diff options
context:
space:
mode:
authorAlex Cope <alexcope@google.com>2017-01-10 16:47:49 -0800
committerEric Biggers <ebiggers@google.com>2017-02-10 20:09:00 +0000
commit698ffc03b70134f4f4af89bf64f3bcb96e358545 (patch)
treead068289c1d832a45eddd612541fe819ca094b9d /crypto/testmgr.c
parentce2ace45d931f46e79e8e3c2e857c083e67be554 (diff)
ANDROID: crypto: heh - Add Hash-Encrypt-Hash (HEH) algorithm
Hash-Encrypt-Hash (HEH) is a proposed block cipher mode of operation which extends the strong pseudo-random permutation property of block ciphers (e.g. AES) to arbitrary length input strings. This provides a stronger notion of security than existing block cipher modes of operation (e.g. CBC, CTR, XTS), though it is usually less performant. It uses two keyed invertible hash functions with a layer of ECB encryption applied in-between. The algorithm is currently specified by the following Internet Draft: https://tools.ietf.org/html/draft-cope-heh-01 This patch adds HEH as a symmetric cipher only. Support for HEH as an AEAD is not yet implemented. HEH will use an existing accelerated ecb(block_cipher) implementation for the encrypt step if available. Accelerated versions of the hash step are planned but will be left for later patches. This patch backports HEH to the 4.4 Android kernel, initially for use by ext4 filenames encryption. Note that HEH is not yet upstream; however, patches have been made available on linux-crypto, and as noted there is also a draft specification available. This backport required updating the code to conform to the legacy ablkcipher API rather than the skcipher API, which wasn't complete in 4.4. Signed-off-by: Alex Cope <alexcope@google.com> Bug: 32975945 Signed-off-by: Eric Biggers <ebiggers@google.com> Change-Id: I945bcc9c0115916824d701bae91b86e3f059a1a9
Diffstat (limited to 'crypto/testmgr.c')
-rw-r--r--crypto/testmgr.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c
index ae8c57fd8bc7..f03ae20a5735 100644
--- a/crypto/testmgr.c
+++ b/crypto/testmgr.c
@@ -3197,6 +3197,21 @@ static const struct alg_test_desc alg_test_descs[] = {
}
}
}, {
+ .alg = "heh(aes)",
+ .test = alg_test_skcipher,
+ .suite = {
+ .cipher = {
+ .enc = {
+ .vecs = aes_heh_enc_tv_template,
+ .count = AES_HEH_ENC_TEST_VECTORS
+ },
+ .dec = {
+ .vecs = aes_heh_dec_tv_template,
+ .count = AES_HEH_DEC_TEST_VECTORS
+ }
+ }
+ }
+ }, {
.alg = "hmac(crc32)",
.test = alg_test_hash,
.suite = {