qcrypto_signature_sigsize()

Retrieve the signature size

Synopsis:

#include <qcrypto/qcrypto.h>
size_t qcrypto_signature_sigsize(qcrypto_ctx_t *ctx)

Arguments:

ctx
The algorithm context object.

Library:

libqcrypto

Description:

This function uses the specified algorithm, its arguments, and private key information to give the caller the size of the signature that will be generated. It allows you to allocate a buffer that is large enough because you know the size of the signature in advance. Although the actual signature size can be different than what this function reports, the reported value is always large enough to contain the full signature of the specific algorithm. The following functions return the correct signature length: qcrypto_signature_sign(), qcrypto_signature_sign_oneshot(), or qcrypto_signature_sign_nodgst().

Returns:

The signature size in bytes.