*
* @remarks This function can be used to learn the required size of the output buffer
* for a single operation (eg. *_update or *_finalize). In case the operation
- * has no input (eg. *_finalize), the value of @b input_len should be set to 0.
+ * has no input (eg. *_finalize), the value of @b input_len has to be set to 0.
*
* @param[in] ctx Previously initialized crypto context
* @param[in] input_len Length of the input data to be processed
}
static int get_digest_output_length(const yaca_context_h ctx,
- UNUSED size_t input_len,
+ size_t input_len,
size_t *output_len)
{
assert(output_len != NULL);
struct yaca_digest_ctx_s *c = get_digest_ctx(ctx);
- if (c == NULL)
+ if (c == NULL || input_len != 0)
return YACA_ERROR_INVALID_PARAMETER;
int md_size = EVP_MD_CTX_size(c->mdctx);
}
static int get_sign_output_length(const yaca_context_h ctx,
- UNUSED size_t input_len,
+ size_t input_len,
size_t *output_len)
{
assert(output_len != NULL);
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
- if (c == NULL)
+ if (c == NULL || input_len != 0)
return YACA_ERROR_INVALID_PARAMETER;
assert(c->mdctx != NULL);