qcrypto_cipher_args_t

QNX SDP8.0QNX OS System Security GuideAPIConfiguration

Cipher algorithm arguments

Synopsis:

#include <qcrypto/qcrypto.h>
typedef struct {
    qcrypto_cipher_action_t    action;
    const uint8_t*             iv;
    size_t                     ivsize;
    qcrypto_cipher_padding_t   padding;
    union {
        union {
            struct {
                size_t		unitsize;
            } xts;
            struct {
                size_t            tagsize;
                const uint8_t    *tag;
            } gcm;
            struct {
                size_t            tagsize;
                const uint8_t    *tag;
                size_t            inputsize;
                size_t            aadsize;
            } ccm;
            struct {
                size_t            tagsize;
                const uint8_t    *tag;
            } ocb;
        } aes;
        struct {
            size_t            tagsize;
            const uint8_t     *tag;
        } chacha20_poly1305;
        struct {
            const uint32_t    counter;
        } chacha20;
        void    *private;
    };
} qcrypto_cipher_args_t;

Data:

qcrypto_cipher_action_t action

The cipher action (encryption or decryption).

uint8_t* iv

The initialization vector (IV) buffer.

size_t ivsize

The IV size.

qcrypto_cipher_padding_t padding

The padding mode.

size_t unitsize

The unit size (usually the block size). Maximum is 16 MiB.

size_t tagsize

The tag (or MAC) size.

uint8_t *tag

The decryption tag.

size_t inputsize

The plaintext or ciphertext size.

size_t aadsize

The AAD size.

uint8_t counter

The block counter.

void* private

Private arguments to pass for other types of ciphers.

Library:

libqcrypto

Description:

The arguments are organized based on the algorithm name. Some modes of operation require extra parameters to set up the algorithm.

The private field can be used for custom plugins that implement custom algorithms that the QNX cryptography library API does not support.

The padding value can only be a value other than QCRYPTO_CIPHER_PADDING_NONE if the cipher is a block cipher; otherwise, an error is returned. See qcrypto_cipher_padding_t.

For more information, see qcrypto_cipher_init().

Page updated: