const yaca_key_h sym_key);
/**
- * @brief Feeds the data into the digital signature or MAC algorithm.
+ * @brief Feeds the message into the digital signature or MAC algorithm.
*
* @since_tizen 3.0
*
- * @param[in,out] ctx Context created by yaca_sign_initialize(),
- * yaca_sign_initialize_hmac() or yaca_sign_initialize_cmac()
- * @param[in] data Data to be signed
- * @param[in] data_len Length of the data
+ * @param[in,out] ctx Context created by yaca_sign_initialize(),
+ * yaca_sign_initialize_hmac() or yaca_sign_initialize_cmac()
+ * @param[in] message Message to be signed
+ * @param[in] message_len Length of the message
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
* @see yaca_sign_initialize_cmac()
*/
int yaca_sign_update(yaca_context_h ctx,
- const char *data,
- size_t data_len);
+ const char *message,
+ size_t message_len);
/**
* @brief Calculates the final signature or MAC.
* signature or MAC of an empty message.
*
* @param[in,out] ctx A valid sign context
- * @param[out] signature Buffer for the MAC or the signature
+ * @param[out] signature Buffer for the MAC or the message signature
* (must be allocated by client, see yaca_context_get_output_length())
* @param[out] signature_len Length of the MAC or the signature,
* actual number of bytes written will be returned here
const yaca_key_h pub_key);
/**
- * @brief Feeds the data into the digital signature verification algorithm.
+ * @brief Feeds the message into the digital signature verification algorithm.
*
* @since_tizen 3.0
*
- * @param[in,out] ctx Context created by yaca_verify_initialize()
- * @param[in] data Data to be verified
- * @param[in] data_len Length of the data
+ * @param[in,out] ctx Context created by yaca_verify_initialize()
+ * @param[in] message Message
+ * @param[in] message_len Length of the message
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
* @see yaca_verify_finalize()
*/
int yaca_verify_update(yaca_context_h ctx,
- const char *data,
- size_t data_len);
+ const char *message,
+ size_t message_len);
/**
* @brief Performs the verification.
* the signature of an empty message.
*
* @param[in,out] ctx A valid verify context
- * @param[in] signature Input signature (returned by yaca_sign_finalize())
- * @param[in] signature_len Size of the signature
+ * @param[in] signature Message signature to be verified
+ * @param[in] signature_len Length of the signature
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*
* @remarks The @a ciphertext should be freed using yaca_free()
*
+ * @remarks The @a plaintext can be NULL but then @a plaintext_len must be 0
+ *
* @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 yaca_key.h for key generation functions)
*
* @remarks The @a plaintext should be freed using yaca_free()
*
+ * @remarks The @a ciphertext can be NULL but then @a ciphertext_len must be 0
+ *
* @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
size_t *plaintext_len);
/**
- * @brief Calculates a digest of a buffer.
+ * @brief Calculates a digest of a message.
*
* @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)
+ * @remarks The @a message can be NULL but then @a message_len must be 0
+ *
+ * @param[in] algo Digest algorithm (select #YACA_DIGEST_SHA256 if unsure)
+ * @param[in] message Message from which the digest is to be calculated
+ * @param[in] message_len Length of the message
+ * @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
* @see yaca_free()
*/
int yaca_simple_calculate_digest(yaca_digest_algorithm_e algo,
- const char *data,
- size_t data_len,
+ const char *message,
+ size_t message_len,
char **digest,
size_t *digest_len);
*
* @remarks The @a signature should be freed using yaca_free()
*
+ * @remarks The @a message can be NULL but then @a message_len must be 0
+ *
* @param[in] algo Digest algorithm that will be used
* @param[in] prv_key Private key that will be used, algorithm is
* deduced based on key type, supported key types:
* - #YACA_KEY_TYPE_RSA_PRIV,
* - #YACA_KEY_TYPE_DSA_PRIV,
* - #YACA_KEY_TYPE_EC_PRIV
- * @param[in] data Data to be signed
- * @param[in] data_len Length of the data
+ * @param[in] message Message to be signed
+ * @param[in] message_len Length of the message
* @param[out] signature Message signature, will be allocated by the library
* @param[out] signature_len Length of the signature
*
*/
int yaca_simple_calculate_signature(yaca_digest_algorithm_e algo,
const yaca_key_h prv_key,
- const char *data,
- size_t data_len,
+ const char *message,
+ size_t message_len,
char **signature,
size_t *signature_len);
*
* @since_tizen 3.0
*
+ * @remarks The @a message can be NULL but then @a message_len must be 0
+ *
* @param[in] algo Digest algorithm that will be used
* @param[in] pub_key Public key that will be used, algorithm is
* deduced based on key type, supported key types:
* - #YACA_KEY_TYPE_RSA_PUB,
* - #YACA_KEY_TYPE_DSA_PUB,
* - #YACA_KEY_TYPE_EC_PUB
- * @param[in] data Signed data
- * @param[in] data_len Length of the data
- * @param[in] signature Message signature
+ * @param[in] message Message
+ * @param[in] message_len Length of the message
+ * @param[in] signature Message signature to be verified
* @param[in] signature_len Length of the signature
*
* @return #YACA_ERROR_NONE on success, negative on error
*/
int yaca_simple_verify_signature(yaca_digest_algorithm_e algo,
const yaca_key_h pub_key,
- const char *data,
- size_t data_len,
+ const char *message,
+ size_t message_len,
const char *signature,
size_t signature_len);
*
* @remarks The @a mac should be freed using yaca_free()
*
- * @param[in] algo Digest algorithm that will be used
- * @param[in] sym_key Key that will be used, supported key types:
- * - #YACA_KEY_TYPE_SYMMETRIC,
- * - #YACA_KEY_TYPE_DES
- * @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
- * @param[out] mac_len Length of the MAC
+ * @remarks The @a message can be NULL but then @a message_len must be 0
+ *
+ * @param[in] algo Digest algorithm that will be used
+ * @param[in] sym_key Key that will be used, supported key types:
+ * - #YACA_KEY_TYPE_SYMMETRIC,
+ * - #YACA_KEY_TYPE_DES
+ * @param[in] message Message to calculate HMAC from
+ * @param[in] message_len Length of the message
+ * @param[out] mac MAC, will be allocated by the library
+ * @param[out] mac_len Length of the MAC
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_simple_calculate_hmac(yaca_digest_algorithm_e algo,
const yaca_key_h sym_key,
- const char *data,
- size_t data_len,
+ const char *message,
+ size_t message_len,
char **mac,
size_t *mac_len);
*
* @remarks The @a mac should be freed using yaca_free()
*
- * @param[in] algo Encryption algorithm that will be used
- * @param[in] sym_key Key that will be used, supported key types:
- * - #YACA_KEY_TYPE_SYMMETRIC,
- * - #YACA_KEY_TYPE_DES
- * @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
- * @param[out] mac_len Length of the MAC
+ * @remarks The @a message can be NULL but then @a message_len must be 0
+ *
+ * @param[in] algo Encryption algorithm that will be used
+ * @param[in] sym_key Key that will be used, supported key types:
+ * - #YACA_KEY_TYPE_SYMMETRIC,
+ * - #YACA_KEY_TYPE_DES
+ * @param[in] message Message to calculate CMAC from
+ * @param[in] message_len Length of the message
+ * @param[out] mac MAC, will be allocated by the library
+ * @param[out] mac_len Length of the MAC
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_simple_calculate_cmac(yaca_encrypt_algorithm_e algo,
const yaca_key_h sym_key,
- const char *data,
- size_t data_len,
+ const char *message,
+ size_t message_len,
char **mac,
size_t *mac_len);