OpenCloudOS-Kernel/Documentation/crypto
Eric Biggers 03d66cfa2a crypto: doc - improve the skcipher API example code
Rewrite the skcipher API example, changing it to encrypt a buffer with
AES-256-XTS.  This addresses various problems with the previous example:

- It requests a specific driver "cbc-aes-aesni", which is unusual.
  Normally users ask for "cbc(aes)", not a specific driver.

- It encrypts only a single AES block.  For the reader, that doesn't
  clearly distinguish the "skcipher" API from the "cipher" API.

- Showing how to encrypt something with bare CBC is arguably a poor
  choice of example, as it doesn't follow modern crypto trends.  Now,
  usually authenticated encryption is recommended, in which case the
  user would use the AEAD API, not skcipher.  Disk encryption is still a
  legitimate use for skcipher, but for that usually XTS is recommended.

- Many other bugs and poor coding practices, such as not setting
  CRYPTO_TFM_REQ_MAY_SLEEP, unnecessarily allocating a heap buffer for
  the IV, unnecessary NULL checks, using a pointless wrapper struct, and
  forgetting to set an error code in one case.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-06-13 14:31:40 +08:00
..
api-aead.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-akcipher.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-digest.rst crypto: doc - Fix hash export state information 2017-02-03 18:16:11 +08:00
api-intro.txt crypt: doc - remove misleading mention of async API 2016-12-01 21:06:34 +08:00
api-kpp.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-rng.rst crypto: doc - optimize compilation 2016-12-13 16:38:07 -07:00
api-samples.rst crypto: doc - improve the skcipher API example code 2019-06-13 14:31:40 +08:00
api-skcipher.rst crypto: doc - fix typo 2017-02-15 13:23:49 +08:00
api.rst crypto: skcipher - remove remnants of internal IV generators 2018-12-23 11:52:45 +08:00
architecture.rst crypto: hash - remove CRYPTO_ALG_TYPE_DIGEST 2019-05-30 15:28:41 +08:00
asymmetric-keys.txt KEYS: Implement PKCS#8 RSA Private Key parser [ver #2] 2018-10-26 09:30:46 +01:00
async-tx-api.txt drivers/dma: remove unused support for MEMSET operations 2013-07-03 16:07:42 -07:00
conf.py docs-rst: add crypto API book to pdf output 2017-05-16 08:44:06 -03:00
crypto_engine.rst docs: crypto_engine.rst: Fix two parse warnings 2018-06-15 12:48:59 -03:00
descore-readme.txt
devel-algos.rst crypto: doc - clarify hash callbacks state machine 2018-03-31 01:33:02 +08:00
index.rst docs: */index.rst: Add newer documents to their respective index.rst 2018-05-08 09:57:35 -06:00
intro.rst crypto: doc - convert crypto API documentation to Sphinx 2016-12-13 16:37:54 -07:00
userspace-if.rst crypto: doc - fix typo in docs 2017-06-22 16:54:07 +08:00