From: Dariusz Michaluk Date: Thu, 11 Aug 2016 12:21:41 +0000 (+0200) Subject: Reorganize API order in header files. X-Git-Tag: submit/tizen/20160901.024233~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50378da0a263e4bdaaa12f58e9976fb6e4d35f77;p=platform%2Fcore%2Fsecurity%2Fyaca.git Reorganize API order in header files. Change-Id: I07bc47cfc3b08e157fe9200e2815957aec14713a --- diff --git a/api/yaca/yaca_crypto.h b/api/yaca/yaca_crypto.h index 5806789..dfdbb8a 100755 --- a/api/yaca/yaca_crypto.h +++ b/api/yaca/yaca_crypto.h @@ -244,19 +244,6 @@ int yaca_context_get_property(const yaca_context_h ctx, void **value, size_t *value_len); -/** - * @brief Destroys the crypto context. Must be called on all contexts that are - * no longer used. Passing #YACA_CONTEXT_NULL is allowed. - * - * @since_tizen 3.0 - * - * @param[in,out] ctx Crypto context - * - * @see #yaca_context_h - * - */ -void yaca_context_destroy(yaca_context_h ctx); - /** * @brief Returns the minimum required size of the output buffer for a single crypto function call. * @@ -286,6 +273,19 @@ int yaca_context_get_output_length(const yaca_context_h ctx, size_t input_len, size_t *output_len); +/** + * @brief Destroys the crypto context. Must be called on all contexts that are + * no longer used. Passing #YACA_CONTEXT_NULL is allowed. + * + * @since_tizen 3.0 + * + * @param[in,out] ctx Crypto context + * + * @see #yaca_context_h + * + */ +void yaca_context_destroy(yaca_context_h ctx); + /** * @} */ diff --git a/api/yaca/yaca_key.h b/api/yaca/yaca_key.h index b9bf0b1..87e3b30 100755 --- a/api/yaca/yaca_key.h +++ b/api/yaca/yaca_key.h @@ -317,19 +317,6 @@ int yaca_key_extract_public(const yaca_key_h prv_key, yaca_key_h *pub_key); */ int yaca_key_extract_parameters(const yaca_key_h key, yaca_key_h *params); -/** - * @brief Release the key created by the library. Passing YACA_KEY_NULL is allowed. - * - * @since_tizen 3.0 - * - * @param[in,out] key Key to be released - * - * @see yaca_key_import() - * @see yaca_key_export() - * @see yaca_key_generate() - */ -void yaca_key_destroy(yaca_key_h key); - /** * @brief Derives a shared secret using Diffie-Helmann or EC Diffie-Helmann key exchange protocol. * @@ -436,6 +423,19 @@ int yaca_key_derive_pbkdf2(const char *password, size_t key_bit_len, yaca_key_h *key); +/** + * @brief Release the key created by the library. Passing YACA_KEY_NULL is allowed. + * + * @since_tizen 3.0 + * + * @param[in,out] key Key to be released + * + * @see yaca_key_import() + * @see yaca_key_export() + * @see yaca_key_generate() + */ +void yaca_key_destroy(yaca_key_h key); + /** * @} */ diff --git a/api/yaca/yaca_simple.h b/api/yaca/yaca_simple.h index e39e347..487c53d 100755 --- a/api/yaca/yaca_simple.h +++ b/api/yaca/yaca_simple.h @@ -45,35 +45,6 @@ extern "C" { * @{ */ -/** - * @brief Calculates a digest of a buffer. - * - * @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. Can be 0. - * @param[out] digest Message digest, will be allocated by the library - * @param[out] digest_len Length of message digest (depends on algorithm) - * - * @return #YACA_ERROR_NONE on success, negative on error - * @retval #YACA_ERROR_NONE Successful - * @retval #YACA_ERROR_INVALID_PARAMETER Required parameters have incorrect values (NULL, - * invalid algo) - * @retval #YACA_ERROR_OUT_OF_MEMORY Out of memory error - * @retval #YACA_ERROR_INTERNAL Internal error - * - * @see #yaca_digest_algorithm_e - * @see yaca_free() - */ -int yaca_simple_calculate_digest(yaca_digest_algorithm_e algo, - const char *data, - size_t data_len, - char **digest, - size_t *digest_len); - /** * @brief Encrypts data using a symmetric cipher. * @@ -148,6 +119,35 @@ int yaca_simple_decrypt(yaca_encrypt_algorithm_e algo, char **plaintext, size_t *plaintext_len); +/** + * @brief Calculates a digest of a buffer. + * + * @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. Can be 0. + * @param[out] digest Message digest, will be allocated by the library + * @param[out] digest_len Length of message digest (depends on algorithm) + * + * @return #YACA_ERROR_NONE on success, negative on error + * @retval #YACA_ERROR_NONE Successful + * @retval #YACA_ERROR_INVALID_PARAMETER Required parameters have incorrect values (NULL, + * invalid algo) + * @retval #YACA_ERROR_OUT_OF_MEMORY Out of memory error + * @retval #YACA_ERROR_INTERNAL Internal error + * + * @see #yaca_digest_algorithm_e + * @see yaca_free() + */ +int yaca_simple_calculate_digest(yaca_digest_algorithm_e algo, + const char *data, + size_t data_len, + char **digest, + size_t *digest_len); + /** * @brief Creates a signature using asymmetric private key. *