Multi-Block Ciphers [BLKCIPHER] [ABLKCIPHER]
Prev | Chapter 3. Developing Cipher Algorithms | Next

## Multi-Block Ciphers [BLKCIPHER] [ABLKCIPHER]

Example of transformations: cbc(aes), ecb(arc4), ...

This section describes the multi-block cipher transformation implementations for both synchronous [BLKCIPHER] and asynchronous [ABLKCIPHER] case. The multi-block ciphers are used for transformations which operate on scatterlists of data supplied to the transformation functions. They output the result into a scatterlist of data as well.

### Registration Specifics

The registration of [BLKCIPHER] or [ABLKCIPHER] algorithms is one of the most standard procedures throughout the crypto API.

Note, if a cipher implementation requires a proper alignment of data, the caller should use the functions of crypto_blkcipher_alignmask() or crypto_ablkcipher_alignmask() respectively to identify a memory alignment mask. The kernel crypto API is able to process requests that are unaligned. This implies, however, additional overhead as the kernel crypto API needs to perform the realignment of the data which may imply moving of data.

### Cipher Definition With struct blkcipher_alg and ablkcipher_alg

Struct blkcipher_alg defines a synchronous block cipher whereas struct ablkcipher_alg defines an asynchronous block cipher.

Please refer to the single block cipher description for schematics of the block cipher usage. The usage patterns are exactly the same for [ABLKCIPHER] and [BLKCIPHER] as they are for plain [CIPHER].

### Specifics Of Asynchronous Multi-Block Cipher

There are a couple of specifics to the [ABLKCIPHER] interface.

First of all, some of the drivers will want to use the Generic ScatterWalk in case the hardware needs to be fed separate chunks of the scatterlist which contains the plaintext and will contain the ciphertext. Please refer to the ScatterWalk interface offered by the Linux kernel scatter / gather list implementation.

Prev | Up | Next
Single-Block Symmetric Ciphers [CIPHER] | Home | Hashing [HASH]