crypto: Add zstd support
Subsystems (3)
Nick Terrell
maintainerPATCH RESEND 1/1 crypto: Add zstd support
Adds zstd support to crypto and scompress. Only supports the default level.
Previously we held off on this patch, since there weren't any users. Now zram is ready for zstd support, but depends on CONFIG_CRYPTO_ZSTD, which isn't defined until this patch is in. I also see a patch adding zstd to pstore [0], which depends on crypto zstd.
[0] lkml.kernel.org/r/9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com
--- crypto/Kconfig | 9 ++ crypto/Makefile | 1 + crypto/testmgr.c | 10 +++ crypto/testmgr.h | 71 +++++++++++++++ crypto/zstd.c | 265 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 356 insertions(+) create mode 100644 crypto/zstd.c
crypto/Kconfig +9 -0
@@ -1677,6 +1677,15 @@ config CRYPTO_LZ4HC help This is the LZ4 high compression mode algorithm. +config CRYPTO_ZSTD + tristate "Zstd compression algorithm" + select CRYPTO_ALGAPI + select CRYPTO_ACOMP2 + select ZSTD_COMPRESS + select ZSTD_DECOMPRESS + help + This is the zstd algorithm. + comment "Random Number Generation" config CRYPTO_ANSI_CPRNG
crypto/Makefile +1 -0
@@ -136,6 +136,7 @@ obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o +obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o ecdh_generic-y := ecc.o ecdh_generic-y += ecdh.o
crypto/testmgr.c +10 -0
@@ -3576,6 +3576,16 @@ static const struct alg_test_desc alg_test_descs[] = { .decomp = __VECS(zlib_deflate_decomp_tv_template) } } + }, { + .alg = "zstd", + .test = alg_test_comp, + .fips_allowed = 1, + .suite = { + .comp = { + .comp = __VECS(zstd_comp_tv_template), + .decomp = __VECS(zstd_decomp_tv_template) + } + } } };
crypto/testmgr.h +71 -0
75 lines not on this page · raw message
crypto/zstd.c new file +265 -0
265 lines not on this page · raw message
Signature · 1 line
2.9.5
Quoted 1 line · Nick Terrell
depends on
CONFIG_CRYPTO_ZSTD, which isn't defined until this patch is in
Yikes! How come I missed that... :)
Quoted 1 line
[0] lkml.kernel.org/r/9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com
-ss
Herbert Xu
maintainerQuoted 8 lines · Sergey Senozhatsky
Quoted 1 line · Nick Terrell
depends on
CONFIG_CRYPTO_ZSTD, which isn't defined until this patch is inYikes! How come I missed that... :)
Quoted 1 line
[0] lkml.kernel.org/r/9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com
Signed-off-by Nick Terrell <[email protected]> ?
Please resend with sign-off.
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Nick Terrell
maintainerQuoted 6 lines · Herbert Xu
Quoted 3 lines · Sergey Senozhatsky
Quoted 1 line · Nick Terrell
depends on
CONFIG_CRYPTO_ZSTD, which isn't defined until this patch is in
Quoted 7 lines
Quoted 5 lines
Yikes! How come I missed that... :)
Quoted 1 line
[0] lkml.kernel.org/r/9c9416b2dff19f05fb4c35879aaa83d11ff72c92.1521626182.git.geliangtang@gmail.com
Signed-off-by Nick Terrell <[email protected]> ?Please resend with sign-off.
Sorry about that, resent as http://lkml.kernel.org/r/[email protected].
Quoted 6 lines
Thanks,
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: https://urldefense.proofpoint.com/v2/url?u=http-3A__gondor.apana.org.au_-7Eherbert_&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=HQM5IQdWOB8WaMoii2dYTw&m=9TJPOvcdtkpIjIAGJJ6-7fzehxatF48hBoFlxI0lAw8&s=79UWdDJu7MxUVoJ2mEANx31Yj5EYfAyJl8noCeBv-4c&e= PGP Key: https://urldefense.proofpoint.com/v2/url?u=http-3A__gondor.apana.org.au_-7Eherbert_pubkey.txt&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=HQM5IQdWOB8WaMoii2dYTw&m=9TJPOvcdtkpIjIAGJJ6-7fzehxatF48hBoFlxI0lAw8&s=9Pll03qIuCxGGfTX0v5TkbxRUh7p76X1keoDqWC49UA&e=