qcrypto_padding_iso7816_pad()

Updated: April 19, 2023

Apply ISO 7816 padding

Synopsis:

#include <qcrypto/qcrypto.h>
int qcrypto_padding_iso7816_pad(const uint8_t *data,
                                size_t size,
                                uint8_t *paddata,
                                size_t *padsize,
                                size_t blocksize)

Arguments:

data
The data buffer to pad (optional). Can overlap with paddata. Omit this parameter to retrieve the padding bytes only, using size.
size
The data buffer size.
paddata
The padded data buffer.
padsize
The combined size of the padded data buffer and the padded data.
blocksize
The algorithm blocksize for padding alignment.

Library:

libqcrypto

Description:

This function pads the data using the specified algorithm. The size of paddata needs to include the correct amount of space for the padding. See qcrypto_padding_iso7816_size() to calculate the required amount.

Returns:

QCRYPTO_R_EOK if successful or qcrypto_errno if an error occurred.