diff options
author | Tom Zanussi <tom.zanussi@linux.intel.com> | 2023-12-05 15:25:27 -0600 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-12-15 17:52:53 +0800 |
commit | 2ec6761df889fdf896fde761abd447596dd8f8c2 (patch) | |
tree | 57cdcb8d80cebd82400a63f7b10a9ba59ce4795d /crypto | |
parent | b190447e0fa3ef7355480d641d078962e03768b4 (diff) | |
download | linux-stable-2ec6761df889fdf896fde761abd447596dd8f8c2.tar.gz linux-stable-2ec6761df889fdf896fde761abd447596dd8f8c2.tar.bz2 linux-stable-2ec6761df889fdf896fde761abd447596dd8f8c2.zip |
crypto: iaa - Add support for deflate-iaa compression algorithm
This patch registers the deflate-iaa deflate compression algorithm and
hooks it up to the IAA hardware using the 'fixed' compression mode
introduced in the previous patch.
Because the IAA hardware has a 4k history-window limitation, only
buffers <= 4k, or that have been compressed using a <= 4k history
window, are technically compliant with the deflate spec, which allows
for a window of up to 32k. Because of this limitation, the IAA fixed
mode deflate algorithm is given its own algorithm name, 'deflate-iaa'.
With this change, the deflate-iaa crypto algorithm is registered and
operational, and compression and decompression operations are fully
enabled following the successful binding of the first IAA workqueue
to the iaa_crypto sub-driver.
when there are no IAA workqueues bound to the driver, the IAA crypto
algorithm can be unregistered by removing the module.
A new iaa_crypto 'verify_compress' driver attribute is also added,
allowing the user to toggle compression verification. If set, each
compress will be internally decompressed and the contents verified,
returning error codes if unsuccessful. This can be toggled with 0/1:
echo 0 > /sys/bus/dsa/drivers/crypto/verify_compress
The default setting is '1' - verify all compresses.
The verify_compress value setting at the time the algorithm is
registered is captured in the algorithm's crypto_ctx and used for all
compresses when using the algorithm.
[ Based on work originally by George Powley, Jing Lin and Kyung Min
Park ]
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/testmgr.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index e23a34337faf..c26aeda85787 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c @@ -4797,6 +4797,16 @@ static const struct alg_test_desc alg_test_descs[] = { } } }, { + .alg = "deflate-iaa", + .test = alg_test_comp, + .fips_allowed = 1, + .suite = { + .comp = { + .comp = __VECS(deflate_comp_tv_template), + .decomp = __VECS(deflate_decomp_tv_template) + } + } + }, { .alg = "dh", .test = alg_test_kpp, .suite = { |