*
* @remarks The @a ctx should be released using yaca_context_destroy()
*
- * @param[out] ctx Newly created context
- * @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:
- * - #YACA_KEY_TYPE_RSA_PRIV,
- * - #YACA_KEY_TYPE_DSA_PRIV,
- * - #YACA_KEY_TYPE_EC_PRIV
+ * @param[out] ctx Newly created context
+ * @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
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_sign_initialize(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key);
+ const yaca_key_h prv_key);
/**
* @brief Initializes a signature context for HMAC.
*
* @remarks The @a ctx should be released using yaca_context_destroy()
*
- * @param[out] ctx Newly created context
- * @param[in] algo Digest algorithm that will be used
- * @param[in] key Symmetric key that will be used, supported key types:
- * - #YACA_KEY_TYPE_SYMMETRIC,
- * - #YACA_KEY_TYPE_DES
+ * @param[out] ctx Newly created context
+ * @param[in] algo Digest algorithm that will be used
+ * @param[in] sym_key Symmetric key that will be used, supported key types:
+ * - #YACA_KEY_TYPE_SYMMETRIC,
+ * - #YACA_KEY_TYPE_DES
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_sign_initialize_hmac(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key);
+ const yaca_key_h sym_key);
/**
* @brief Initializes a signature context for CMAC.
*
* @remarks The @a ctx should be released using yaca_context_destroy()
*
- * @param[out] ctx Newly created context
- * @param[in] algo Encryption algorithm that will be used
- * @param[in] key Symmetric key that will be used, supported key types:
- * - #YACA_KEY_TYPE_SYMMETRIC,
- * - #YACA_KEY_TYPE_DES
+ * @param[out] ctx Newly created context
+ * @param[in] algo Encryption algorithm that will be used
+ * @param[in] sym_key Symmetric key that will be used, supported key types:
+ * - #YACA_KEY_TYPE_SYMMETRIC,
+ * - #YACA_KEY_TYPE_DES
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_sign_initialize_cmac(yaca_context_h *ctx,
yaca_encrypt_algorithm_e algo,
- const yaca_key_h key);
+ const yaca_key_h sym_key);
/**
* @brief Feeds the data into the digital signature or MAC algorithm.
*
* @remarks The @a ctx should be released using yaca_context_destroy()
*
- * @param[out] ctx Newly created context
- * @param[in] algo Digest algorithm that will be used
- * @param[in] 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[out] ctx Newly created context
+ * @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
*
* @return #YACA_ERROR_NONE on success, negative on error
* @retval #YACA_ERROR_NONE Successful
*/
int yaca_verify_initialize(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key);
+ const yaca_key_h pub_key);
/**
* @brief Feeds the data into the digital signature verification algorithm.
* @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
+ * @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[out] signature Message signature, will be allocated by the library
* @see yaca_free()
*/
int yaca_simple_calculate_signature(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h prv_key,
const char *data,
size_t data_len,
char **signature,
* @since_tizen 3.0
*
* @param[in] algo Digest algorithm that will be used
- * @param[in] key Public key that will be used, algorithm is
+ * @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
* @see yaca_simple_calculate_signature()
*/
int yaca_simple_verify_signature(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h pub_key,
const char *data,
size_t data_len,
const char *signature,
* @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:
+ * @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
* @see yaca_free()
*/
int yaca_simple_calculate_hmac(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h sym_key,
const char *data,
size_t data_len,
char **mac,
* @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:
+ * @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
* @see yaca_free()
*/
int yaca_simple_calculate_cmac(yaca_encrypt_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h sym_key,
const char *data,
size_t data_len,
char **mac,
API int yaca_sign_initialize(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key)
+ const yaca_key_h prv_key)
{
struct yaca_sign_context_s *nc = NULL;
const EVP_MD *md = NULL;
int ret;
- const struct yaca_key_evp_s *evp_key = key_get_evp(key);
+ const struct yaca_key_evp_s *evp_key = key_get_evp(prv_key);
if (ctx == NULL || evp_key == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- switch (key->type) {
+ switch (prv_key->type) {
case YACA_KEY_TYPE_RSA_PRIV:
case YACA_KEY_TYPE_DSA_PRIV:
case YACA_KEY_TYPE_EC_PRIV:
API int yaca_sign_initialize_hmac(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key)
+ const yaca_key_h sym_key)
{
struct yaca_sign_context_s *nc = NULL;
EVP_PKEY *pkey = NULL;
const EVP_MD *md;
int ret;
- const struct yaca_key_simple_s *simple_key = key_get_simple(key);
+ const struct yaca_key_simple_s *simple_key = key_get_simple(sym_key);
if (ctx == NULL || simple_key == NULL ||
- (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
+ (sym_key->type != YACA_KEY_TYPE_SYMMETRIC && sym_key->type != YACA_KEY_TYPE_DES))
return YACA_ERROR_INVALID_PARAMETER;
ret = yaca_zalloc(sizeof(struct yaca_sign_context_s), (void**)&nc);
API int yaca_sign_initialize_cmac(yaca_context_h *ctx,
yaca_encrypt_algorithm_e algo,
- const yaca_key_h key)
+ const yaca_key_h sym_key)
{
struct yaca_sign_context_s *nc = NULL;
CMAC_CTX* cmac_ctx = NULL;
const EVP_CIPHER* cipher = NULL;
EVP_PKEY *pkey = NULL;
int ret;
- const struct yaca_key_simple_s *simple_key = key_get_simple(key);
+ const struct yaca_key_simple_s *simple_key = key_get_simple(sym_key);
if (ctx == NULL || simple_key == NULL ||
- (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
+ (sym_key->type != YACA_KEY_TYPE_SYMMETRIC && sym_key->type != YACA_KEY_TYPE_DES))
return YACA_ERROR_INVALID_PARAMETER;
ret = yaca_zalloc(sizeof(struct yaca_sign_context_s), (void**)&nc);
API int yaca_verify_initialize(yaca_context_h *ctx,
yaca_digest_algorithm_e algo,
- const yaca_key_h key)
+ const yaca_key_h pub_key)
{
struct yaca_sign_context_s *nc = NULL;
const EVP_MD *md = NULL;
int ret;
- const struct yaca_key_evp_s *evp_key = key_get_evp(key);
+ const struct yaca_key_evp_s *evp_key = key_get_evp(pub_key);
if (ctx == NULL || evp_key == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- switch (key->type) {
+ switch (pub_key->type) {
case YACA_KEY_TYPE_RSA_PUB:
case YACA_KEY_TYPE_DSA_PUB:
case YACA_KEY_TYPE_EC_PUB:
}
API int yaca_simple_calculate_signature(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h prv_key,
const char *data,
size_t data_len,
char **signature,
signature == NULL || signature_len == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- ret = yaca_sign_initialize(&ctx, algo, key);
+ ret = yaca_sign_initialize(&ctx, algo, prv_key);
if (ret != YACA_ERROR_NONE)
return ret;
}
API int yaca_simple_verify_signature(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h pub_key,
const char *data,
size_t data_len,
const char *signature,
signature == NULL || signature_len == 0)
return YACA_ERROR_INVALID_PARAMETER;
- ret = yaca_verify_initialize(&ctx, algo, key);
+ ret = yaca_verify_initialize(&ctx, algo, pub_key);
if (ret != YACA_ERROR_NONE)
return ret;
}
API int yaca_simple_calculate_hmac(yaca_digest_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h sym_key,
const char *data,
size_t data_len,
char **mac,
mac == NULL || mac_len == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- ret = yaca_sign_initialize_hmac(&ctx, algo, key);
+ ret = yaca_sign_initialize_hmac(&ctx, algo, sym_key);
if (ret != YACA_ERROR_NONE)
return ret;
}
API int yaca_simple_calculate_cmac(yaca_encrypt_algorithm_e algo,
- const yaca_key_h key,
+ const yaca_key_h sym_key,
const char *data,
size_t data_len,
char **mac,
mac == NULL || mac_len == NULL)
return YACA_ERROR_INVALID_PARAMETER;
- ret = yaca_sign_initialize_cmac(&ctx, algo, key);
+ ret = yaca_sign_initialize_cmac(&ctx, algo, sym_key);
if (ret != YACA_ERROR_NONE)
return ret;