X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=crypt.h;h=85629591880ad03f2d2d010f194667be1db4c121;hb=refs%2Fheads%2Fpu;hp=5ca6a54112b60f6d61b16485248fb28ff708df6b;hpb=46b9e018548fa7baebe62b6c724d215c84dcb20f;p=paraslash.git diff --git a/crypt.h b/crypt.h index 5ca6a541..2e094ced 100644 --- a/crypt.h +++ b/crypt.h @@ -20,18 +20,18 @@ struct asymmetric_key; * \param pub: The public key. * \param inbuf The input buffer. * \param len The length of \a inbuf. - * \param outbuf The output buffer. + * \param outbuf The output buffer will be allocated by the callee. * * \return The size of the encrypted data on success, negative on errors. */ int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, - unsigned len, unsigned char *outbuf); + unsigned len, unsigned char **outbuf); /** * Decrypt a buffer using a private key. * * \param key_file Full path of the key. - * \param outbuf The output buffer. + * \param outbuf The output buffer is allocated by the callee. * \param inbuf The encrypted input buffer. * \param inlen The length of \a inbuf. * @@ -39,7 +39,7 @@ int apc_pub_encrypt(struct asymmetric_key *pub, unsigned char *inbuf, * * \return The size of the recovered plaintext on success, negative on errors. */ -int apc_priv_decrypt(const char *key_file, unsigned char *outbuf, +int apc_priv_decrypt(const char *key_file, unsigned char **outbuf, unsigned char *inbuf, int inlen); /** @@ -48,7 +48,7 @@ int apc_priv_decrypt(const char *key_file, unsigned char *outbuf, * \param key_file The file containing the key. * \param result The key structure is returned here. * - * \return The size of the key on success, negative on errors. + * \return The size of the key in bytes on success, negative on errors. */ int apc_get_pubkey(const char *key_file, struct asymmetric_key **result);