aboutsummaryrefslogtreecommitdiff
path: root/hal.h
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-08-22 17:47:22 -0400
committerRob Austein <sra@hactrn.net>2015-08-22 17:47:22 -0400
commit9e4c5edc6ef46b4c182379eab46abb45e5d2022f (patch)
tree684c35799a6602f0bb9b7563258c0c1525a25b2b /hal.h
parent511819f0f73c5f37d3f7c033f01d29ef88bfa9cb (diff)
Add hal_ecdsa_verify(). Move hashing out of ECDSA routines. Clean up
a few bits that didn't pass self-review.
Diffstat (limited to 'hal.h')
-rw-r--r--hal.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/hal.h b/hal.h
index 9e7bd67..4417af8 100644
--- a/hal.h
+++ b/hal.h
@@ -447,6 +447,7 @@
DEFINE_HAL_ERROR(HAL_ERROR_RESULT_TOO_LONG, "Result too long for buffer") \
DEFINE_HAL_ERROR(HAL_ERROR_ASN1_PARSE_FAILED, "ASN.1 parse failed") \
DEFINE_HAL_ERROR(HAL_ERROR_KEY_NOT_ON_CURVE, "EC key is not on its purported curve") \
+ DEFINE_HAL_ERROR(HAL_ERROR_INVALID_SIGNATURE, "Invalid signature") \
END_OF_HAL_ERROR_LIST
/* Marker to forestall silly line continuation errors */
@@ -711,15 +712,6 @@ extern hal_error_t hal_ecdsa_key_get_public(const hal_ecdsa_key_t * const key,
extern void hal_ecdsa_key_clear(hal_ecdsa_key_t *key);
-extern hal_error_t hal_ecdsa_sign(const hal_ecdsa_key_t * const key,
- const hal_hash_descriptor_t * const hash_descriptor,
- const uint8_t * const input, const size_t input_len,
- uint8_t *output, size_t *output_len, const size_t output_max);
-
-extern hal_error_t hal_ecdsa_verify(const hal_ecdsa_key_t * const key,
- const hal_hash_descriptor_t * const hash_descriptor,
- const uint8_t * const input, const size_t input_len);
-
extern hal_error_t hal_ecdsa_key_gen(hal_ecdsa_key_t **key,
void *keybuf, const size_t keybuf_len,
const hal_ecdsa_curve_t curve);
@@ -733,6 +725,14 @@ extern hal_error_t hal_ecdsa_key_from_der(hal_ecdsa_key_t **key,
void *keybuf, const size_t keybuf_len,
const uint8_t * const der, const size_t der_len);
+extern hal_error_t hal_ecdsa_sign(const hal_ecdsa_key_t * const key,
+ const uint8_t * const hash, const size_t hash_len,
+ uint8_t *signature, size_t *signature_len, const size_t signature_max);
+
+extern hal_error_t hal_ecdsa_verify(const hal_ecdsa_key_t * const key,
+ const uint8_t * const hash, const size_t hash_len,
+ const uint8_t * const signature, const size_t signature_len);
+
#endif /* _HAL_H_ */
/*