/* Operation type saved in context to recognize what
* type of operation is performed and how to perform it.
-*/
+ */
enum sign_op_type {
OP_SIGN = 0,
OP_VERIFY = 1
}
}
-static int get_sign_output_length(const yaca_ctx_h ctx, size_t input_len, size_t *output_len)
+static int get_sign_output_length(const yaca_ctx_h ctx,
+ size_t input_len,
+ size_t *output_len)
{
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
c->mdctx = NULL;
}
-int set_sign_param(yaca_ctx_h ctx, yaca_ex_param_e param, const void *value, size_t value_len)
+int set_sign_param(yaca_ctx_h ctx,
+ yaca_ex_param_e param,
+ const void *value,
+ size_t value_len)
{
int ret;
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
return 0;
}
-int get_sign_param(const yaca_ctx_h ctx, yaca_ex_param_e param, void **value, size_t *value_len)
+int get_sign_param(const yaca_ctx_h ctx,
+ yaca_ex_param_e param,
+ void **value,
+ size_t *value_len)
{
int ret;
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
}
API int yaca_sign_init(yaca_ctx_h *ctx,
- yaca_digest_algo_e algo,
- const yaca_key_h key)
+ yaca_digest_algo_e algo,
+ const yaca_key_h key)
{
struct yaca_sign_ctx_s *nc = NULL;
const EVP_MD *md = NULL;
const struct yaca_key_simple_s *simple_key = key_get_simple(key);
if (ctx == NULL || simple_key == NULL ||
- (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
+ (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
return YACA_ERROR_INVALID_ARGUMENT;
nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
const struct yaca_key_simple_s *simple_key = key_get_simple(key);
if (ctx == NULL || simple_key == NULL ||
- (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
+ (key->type != YACA_KEY_TYPE_SYMMETRIC && key->type != YACA_KEY_TYPE_DES))
return YACA_ERROR_INVALID_ARGUMENT;
nc = yaca_zalloc(sizeof(struct yaca_sign_ctx_s));
}
API int yaca_sign_update(yaca_ctx_h ctx,
- const char *data,
- size_t data_len)
+ const char *data,
+ size_t data_len)
{
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
int ret;
}
API int yaca_sign_final(yaca_ctx_h ctx,
- char *signature,
- size_t *signature_len)
+ char *signature,
+ size_t *signature_len)
{
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
int ret;
}
API int yaca_verify_init(yaca_ctx_h *ctx,
- yaca_digest_algo_e algo,
- const yaca_key_h key)
+ yaca_digest_algo_e algo,
+ const yaca_key_h key)
{
struct yaca_sign_ctx_s *nc = NULL;
const EVP_MD *md = NULL;
}
API int yaca_verify_update(yaca_ctx_h ctx,
- const char *data,
- size_t data_len)
+ const char *data,
+ size_t data_len)
{
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
int ret;