Single Block Cipher API

crypto_alloc_cipher — allocate single block cipher handle
crypto_free_cipher — zeroize and free the single block cipher handle
crypto_has_cipher — Search for the availability of a single block cipher
crypto_cipher_blocksize — obtain block size for cipher
crypto_cipher_setkey — set key for cipher
crypto_cipher_encrypt_one — encrypt one block of plaintext
crypto_cipher_decrypt_one — decrypt one block of ciphertext

The single block cipher API is used with the ciphers of type CRYPTO_ALG_TYPE_CIPHER (listed as type cipher in /proc/crypto).

Using the single block cipher API calls, operations with the basic cipher primitive can be implemented. These cipher primitives exclude any block chaining operations including IV handling.

The purpose of this single block cipher API is to support the implementation of templates or other concepts that only need to perform the cipher operation on one block at a time. Templates invoke the underlying cipher primitive block-wise and process either the input or the output data of these cipher operations.