devcrypto_cipher_op_init

Updated: April 19, 2023

Initialize a cipher algorithm state

Synopsis:

#include <dev/crypto/devcrypto_plugin.h>
typedef int(* devcrypto_cipher_op_init)(devcrypto_state_ctx_t *sctx,
            const uint8_t *key,
            uint32_t keysize,
            const uint8_t *iv,
            uint32_t ivsize,
            int encrypt);

Arguments:

sctx
The state context.
key
The cipher key.
keysize
The cipher key size.
iv
The initialization vector (IV).
ivsize
The IV size.
encrypt
Either 1 (encrypt function) or 0 (decrypt function).

Library:

devcr

Description:

Because devcrypto works using ciphers with no padding, plugins need to make sure that cipher padding is turned off. The caller is responsible for providing the cipher with padded and aligned data.

Returns:

EOK if successful or errno if an error occurred.