linux/include/crypto
Eric Biggers 877b5691f2 crypto: shash - remove shash_desc::flags
The flags field in 'struct shash_desc' never actually does anything.
The only ostensibly supported flag is CRYPTO_TFM_REQ_MAY_SLEEP.
However, no shash algorithm ever sleeps, making this flag a no-op.

With this being the case, inevitably some users who can't sleep wrongly
pass MAY_SLEEP.  These would all need to be fixed if any shash algorithm
actually started sleeping.  For example, the shash_ahash_*() functions,
which wrap a shash algorithm with the ahash API, pass through MAY_SLEEP
from the ahash API to the shash API.  However, the shash functions are
called under kmap_atomic(), so actually they're assumed to never sleep.

Even if it turns out that some users do need preemption points while
hashing large buffers, we could easily provide a helper function
crypto_shash_update_large() which divides the data into smaller chunks
and calls crypto_shash_update() and cond_resched() for each chunk.  It's
not necessary to have a flag in 'struct shash_desc', nor is it necessary
to make individual shash algorithms aware of this at all.

Therefore, remove shash_desc::flags, and document that the
crypto_shash_*() functions can be called from any context.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-04-25 15:38:12 +08:00
..
internal crypto: simd,testmgr - introduce crypto_simd_usable() 2019-03-22 20:57:27 +08:00
acompress.h crypto: user - fix use_after_free of struct xxx_request 2018-12-07 14:15:00 +08:00
aead.h crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
aes.h crypto: aes - Use ___cacheline_aligned for aes data 2019-04-08 14:36:16 +08:00
akcipher.h X.509: parse public key parameters from x509 for akcipher 2019-04-18 22:15:02 +08:00
algapi.h crypto: api - add a helper to (un)register a array of templates 2019-01-25 18:41:52 +08:00
arc4.h crypto: export arc4 defines 2019-02-15 13:21:55 +08:00
asym_tpm_subtype.h KEYS: asym_tpm: extract key size & public key [ver #2] 2018-10-26 09:30:46 +01:00
authenc.h crypto: authenc - Export key parsing helper function 2013-10-16 20:56:25 +08:00
b128ops.h [CRYPTO] lib: some common 128-bit block operations, nicely centralized 2006-12-06 18:38:55 -08:00
blowfish.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cast5.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cast6.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cast_common.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cbc.h crypto: cbc - Remove VLA usage 2018-09-04 11:35:03 +08:00
chacha.h crypto: chacha - add XChaCha12 support 2018-11-20 14:26:55 +08:00
cryptd.h crypto: cryptd - remove ability to instantiate ablkciphers 2019-04-18 22:15:04 +08:00
crypto_wq.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ctr.h [CRYPTO] ctr: Refactor into ctr and rfc3686 2008-01-11 08:16:41 +11:00
des.h crypto: des_generic - Forbid 2-key in 3DES and add helpers 2019-04-18 22:14:58 +08:00
dh.h crypto: dh - add public key verification test 2018-07-09 00:26:22 +08:00
drbg.h crypto: drbg - in-place cipher operation for CTR 2018-08-03 18:05:48 +08:00
ecdh.h crypto: ecdh - return unsigned value for crypto_ecdh_key_len() 2017-10-12 22:55:00 +08:00
engine.h crypto: engine - Permit to enqueue all async requests 2018-02-15 23:26:50 +08:00
gcm.h crypto: gcm - add GCM IV size constant 2017-09-22 17:43:08 +08:00
gf128mul.h crypto: gf128mul - The x8_ble multiplication functions 2017-11-03 21:50:43 +08:00
ghash.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
hash_info.h crypto: streebog - register Streebog in hash info for IMA 2018-11-16 14:09:40 +08:00
hash.h crypto: shash - remove shash_desc::flags 2019-04-25 15:38:12 +08:00
hmac.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
if_alg.h crypto: af_alg - make some functions static 2019-01-18 18:43:43 +08:00
kpp.h crypto: user - fix use_after_free of struct xxx_request 2018-12-07 14:15:00 +08:00
md5.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
morus640_glue.h crypto: x86/morus640 - convert to use AEAD SIMD helpers 2019-03-22 20:57:26 +08:00
morus1280_glue.h crypto: x86/morus1280 - convert to use AEAD SIMD helpers 2019-03-22 20:57:26 +08:00
morus_common.h crypto: morus - Cleanup license mess 2019-01-25 18:41:51 +08:00
nhpoly1305.h crypto: nhpoly1305 - add NHPoly1305 support 2018-11-20 14:26:56 +08:00
null.h crypto: null - Remove VLA usage of skcipher 2018-09-28 12:46:08 +08:00
padlock.h crypto: padlock - Move padlock.h into include/crypto 2011-01-07 14:52:00 +11:00
pcrypt.h crypto: pcrypt - Add pcrypt crypto parallelization wrapper 2010-01-07 15:57:19 +11:00
pkcs7.h PKCS#7: Make trust determination dependent on contents of trust keyring 2016-04-06 16:14:24 +01:00
poly1305.h crypto: poly1305 - add Poly1305 core API 2018-11-20 14:26:56 +08:00
public_key.h X.509: parse public key parameters from x509 for akcipher 2019-04-18 22:15:02 +08:00
rng.h crypto: user - fix use_after_free of struct xxx_request 2018-12-07 14:15:00 +08:00
scatterwalk.h crypto: scatterwalk - remove scatterwalk_samebuf() 2018-08-03 18:06:04 +08:00
serpent.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sha1_base.h crypto: sha1 - implement base layer for SHA-1 2015-04-10 21:39:39 +08:00
sha3.h crypto: sha3-generic - export init/update/final routines 2018-01-26 01:10:34 +11:00
sha256_base.h crypto: sha256 - implement base layer for SHA-256 2015-04-10 21:39:39 +08:00
sha512_base.h crypto: sha512 - implement base layer for SHA-512 2015-04-10 21:39:39 +08:00
sha.h crypto: sha512_generic - add a sha384 0-length pre-computed hash 2018-06-22 23:03:05 +08:00
skcipher.h crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
sm3_base.h crypto: sm3 - add OSCCA SM3 secure hash 2017-09-22 17:43:07 +08:00
sm3.h crypto: sm3 - add OSCCA SM3 secure hash 2017-09-22 17:43:07 +08:00
sm4.h crypto: sm4 - export encrypt/decrypt routines to other drivers 2018-05-05 14:52:51 +08:00
streebog.h crypto: streebog - fix unaligned memory accesses 2019-04-08 14:42:55 +08:00
twofish.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
xts.h crypto: clarify name of WEAK_KEY request flag 2019-01-25 18:41:52 +08:00