1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Document assumption of mbedtls_get_pkcs_padding

Point out that the input length must be the same as the cipher's block
size.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann
2025-03-28 17:33:45 +00:00
parent bbf1a01503
commit 850e5b317d

View File

@ -839,6 +839,11 @@ static void add_pkcs_padding(unsigned char *output, size_t output_len,
}
}
/*
* Get the length of the PKCS7 padding.
*
* Note: input_len must be the block size of the cipher.
*/
MBEDTLS_STATIC_TESTABLE int mbedtls_get_pkcs_padding(unsigned char *input,
size_t input_len,
size_t *data_len)