ACR: Modify remarks related to pointer/handle cleanup
[platform/core/security/yaca.git] / api / yaca / yaca_simple.h
index 5dd2b13..86f2f88 100644 (file)
@@ -50,11 +50,12 @@ extern "C" {
  *
  * @since_tizen 3.0
  *
+ * @remarks  The @a digest should be freed using yaca_free()
+ *
  * @param[in]  algo        Digest algorithm (select #YACA_DIGEST_SHA256 if unsure)
  * @param[in]  data        Data from which the digest is to be calculated
  * @param[in]  data_len    Length of the data
  * @param[out] digest      Message digest, will be allocated by the library
- *                         (should be freed with yaca_free())
  * @param[out] digest_len  Length of message digest (depends on algorithm)
  *
  * @return #YACA_ERROR_NONE on success, negative on error
@@ -78,6 +79,8 @@ int yaca_simple_calculate_digest(yaca_digest_algorithm_e algo,
  *
  * @since_tizen 3.0
  *
+ * @remarks  The @a ciphertext should be freed using yaca_free()
+ *
  * @param[in]  algo            Encryption algorithm (select #YACA_ENCRYPT_AES if unsure)
  * @param[in]  bcm             Chaining mode (select #YACA_BCM_CBC if unsure)
  * @param[in]  sym_key         Symmetric encryption key (see key.h for key generation functions)
@@ -85,7 +88,6 @@ int yaca_simple_calculate_digest(yaca_digest_algorithm_e algo,
  * @param[in]  plaintext       Plaintext to be encrypted
  * @param[in]  plaintext_len   Length of the plaintext
  * @param[out] ciphertext      Encrypted data, will be allocated by the library
- *                             (should be freed with yaca_free())
  * @param[out] ciphertext_len  Length of the encrypted data (may be larger than decrypted)
  *
  * @return #YACA_ERROR_NONE on success, negative on error
@@ -114,6 +116,8 @@ int yaca_simple_encrypt(yaca_encrypt_algorithm_e algo,
  *
  * @since_tizen 3.0
  *
+ * @remarks  The @a plaintext should be freed using yaca_free()
+ *
  * @param[in]  algo            Decryption algorithm that was used to encrypt the data
  * @param[in]  bcm             Chaining mode that was used to encrypt the data
  * @param[in]  sym_key         Symmetric encryption key that was used to encrypt the data
@@ -121,7 +125,6 @@ int yaca_simple_encrypt(yaca_encrypt_algorithm_e algo,
  * @param[in]  ciphertext      Ciphertext to be decrypted
  * @param[in]  ciphertext_len  Length of ciphertext
  * @param[out] plaintext       Decrypted data, will be allocated by the library
- *                             (should be freed with yaca_free())
  * @param[out] plaintext_len   Length of the decrypted data
  *
  * @return #YACA_ERROR_NONE on success, negative on error
@@ -150,6 +153,8 @@ int yaca_simple_decrypt(yaca_encrypt_algorithm_e algo,
  *
  * @since_tizen 3.0
  *
+ * @remarks  The @a signature should be freed using yaca_free()
+ *
  * @param[in]  algo           Digest algorithm that will be used
  * @param[in]  key            Private key that will be used, algorithm is
  *                            deduced based on key type, supported key types:
@@ -158,7 +163,6 @@ int yaca_simple_decrypt(yaca_encrypt_algorithm_e algo,
  * @param[in]  data           Data to be signed
  * @param[in]  data_len       Length of the data
  * @param[out] signature      Message signature, will be allocated by the
- *                            library (should be freed with yaca_free())
  * @param[out] signature_len  Length of the signature
  *
  * @return #YACA_ERROR_NONE on success, negative on error
@@ -222,6 +226,8 @@ int yaca_simple_verify_signature(yaca_digest_algorithm_e algo,
  * @remarks  For verification, calculate message HMAC and compare with received MAC using
  *           yaca_memcmp().
  *
+ * @remarks  The @a mac should be freed using yaca_free()
+ *
  * @param[in]  algo      Digest algorithm that will be used
  * @param[in]  key       Key that will be used, supported key types:
  *                       - #YACA_KEY_TYPE_SYMMETRIC,
@@ -229,7 +235,6 @@ int yaca_simple_verify_signature(yaca_digest_algorithm_e algo,
  * @param[in]  data      Data to calculate HMAC from
  * @param[in]  data_len  Length of the data
  * @param[out] mac       MAC, will be allocated by the library
- *                       (should be freed with yaca_free())
  * @param[out] mac_len   Length of the MAC
  *
  * @return #YACA_ERROR_NONE on success, negative on error
@@ -259,6 +264,8 @@ int yaca_simple_calculate_hmac(yaca_digest_algorithm_e algo,
  * @remarks  For verification, calculate message CMAC and compare with received MAC using
  *           yaca_memcmp().
  *
+ * @remarks  The @a mac should be freed using yaca_free()
+ *
  * @param[in]  algo      Encryption algorithm that will be used
  * @param[in]  key       Key that will be used, supported key types:
  *                       - #YACA_KEY_TYPE_SYMMETRIC,
@@ -266,7 +273,6 @@ int yaca_simple_calculate_hmac(yaca_digest_algorithm_e algo,
  * @param[in]  data      Data to calculate CMAC from
  * @param[in]  data_len  Length of the data
  * @param[out] mac       MAC, will be allocated by the library
- *                       (should be freed with yaca_free())
  * @param[out] mac_len   Length of the MAC
  *
  * @return #YACA_ERROR_NONE on success, negative on error