From b77148ddc3def71e6c412c3afb5f1c20be2d77cd Mon Sep 17 00:00:00 2001 From: Alberto Compagno Date: Wed, 6 Feb 2019 12:05:58 +0100 Subject: [CICN-14] Removed copy of signature in libparc. The api now accepts a pointer to a buf where it stores the computed signature Change-Id: I4427a6399b5e74197303bade4f96ea74b370b07b Signed-off-by: Alberto Compagno --- libparc/parc/security/parc_Signer.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libparc/parc/security/parc_Signer.h') diff --git a/libparc/parc/security/parc_Signer.h b/libparc/parc/security/parc_Signer.h index bee68fd2..9bb0c6a1 100755 --- a/libparc/parc/security/parc_Signer.h +++ b/libparc/parc/security/parc_Signer.h @@ -84,10 +84,12 @@ typedef struct parc_signer_interface { * * @param [in] interfaceContextPtr A pointer to a concrete PARCSigner instance. * @param [in] hashToSign The output of the given digest to sign + * @param [in] signature Portion of memory that will contain the signature (expected to be large enough to contain the signature) + * @param [in] sig_len Size in bytes of the supplied buffer * * @return A pointer to a PARCSignature instance that must be released via parcSignature_Release() */ - PARCSignature *(*SignDigest)(void *interfaceContext, const PARCCryptoHash * parcDigest); + PARCSignature *(*SignDigest)(void *interfaceContext, const PARCCryptoHash * parcDigest, uint8_t * signature, uint32_t sign_len); /** * Return the PARSigningAlgorithm used for signing with the given `PARCSigner` @@ -283,6 +285,8 @@ PARCCryptoHasher *parcSigner_GetCryptoHasher(const PARCSigner *signer); * * @param [in] signer A pointer to a PARCSigner instance. * @param [in] hashToSign The output of the given digest + * @param [in] signature Portion of memory that will contain the signature (expected to be large enough to contain the signature) + * @param [in] sig_len Size in bytes of the supplied buffer * * @return A pointer to a PARCSignature instance that must be released via parcSignature_Release() * @@ -300,7 +304,7 @@ PARCCryptoHasher *parcSigner_GetCryptoHasher(const PARCSigner *signer); * } * @endcode */ -PARCSignature *parcSigner_SignDigest(const PARCSigner *signer, const PARCCryptoHash *hashToSign); +PARCSignature *parcSigner_SignDigest(const PARCSigner *signer, const PARCCryptoHash *hashToSign, uint8_t * signature, uint32_t sig_len); /** * Compute the signature of a given `PARCBuffer`. @@ -320,7 +324,7 @@ PARCSignature *parcSigner_SignDigest(const PARCSigner *signer, const PARCCryptoH * } * @endcode */ -PARCSignature *parcSigner_SignBuffer(const PARCSigner *signer, const PARCBuffer *buffer); +PARCSignature *parcSigner_SignBuffer(const PARCSigner *signer, const PARCBuffer *buffer, uint8_t * signature, uint32_t sig_len); /** * Return the PARSigningAlgorithm used for signing with the given `PARCSigner` -- cgit 1.2.3-korg