aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2017-05-23 00:07:48 -0400
committerRob Austein <sra@hactrn.net>2017-05-23 00:08:07 -0400
commitaf3f0e2f7a6be49603daf7b97cf8db0fda293a84 (patch)
tree693c1f5d22e026eab8ce9506d8dae28fbe4b4924
parentd532e6bbcd63c550f91fc97446f6114f37d18bde (diff)
parentf67796b71895f43912a4cd30e9f894946023e811 (diff)
Merge branch 'master' into ks9
-rw-r--r--ecdsa.c6
-rw-r--r--hal.h12
-rw-r--r--rsa.c12
3 files changed, 15 insertions, 15 deletions
diff --git a/ecdsa.c b/ecdsa.c
index 27c4c2e..8791ebe 100644
--- a/ecdsa.c
+++ b/ecdsa.c
@@ -969,7 +969,7 @@ static int point_is_on_curve(const ec_point_t * const P,
* Generate a new ECDSA key.
*/
-hal_error_t hal_ecdsa_key_gen(const hal_core_t *core,
+hal_error_t hal_ecdsa_key_gen(hal_core_t *core,
hal_ecdsa_key_t **key_,
void *keybuf, const size_t keybuf_len,
const hal_curve_name_t curve_)
@@ -1608,7 +1608,7 @@ static hal_error_t decode_signature_pkcs11(const ecdsa_curve_t * const curve,
* Sign a caller-supplied hash.
*/
-hal_error_t hal_ecdsa_sign(const hal_core_t *core,
+hal_error_t hal_ecdsa_sign(hal_core_t *core,
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)
@@ -1689,7 +1689,7 @@ hal_error_t hal_ecdsa_sign(const hal_core_t *core,
* Verify a signature using a caller-supplied hash.
*/
-hal_error_t hal_ecdsa_verify(const hal_core_t *core,
+hal_error_t hal_ecdsa_verify(hal_core_t *core,
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)
diff --git a/hal.h b/hal.h
index c89083c..a3ea1dd 100644
--- a/hal.h
+++ b/hal.h
@@ -458,17 +458,17 @@ extern hal_error_t hal_rsa_key_get_public_exponent(const hal_rsa_key_t * const k
extern void hal_rsa_key_clear(hal_rsa_key_t *key);
-extern hal_error_t hal_rsa_encrypt(const hal_core_t *core,
+extern hal_error_t hal_rsa_encrypt(hal_core_t *core,
const hal_rsa_key_t * const key,
const uint8_t * const input, const size_t input_len,
uint8_t * output, const size_t output_len);
-extern hal_error_t hal_rsa_decrypt(const hal_core_t *core,
+extern hal_error_t hal_rsa_decrypt(hal_core_t *core,
const hal_rsa_key_t * const key,
const uint8_t * const input, const size_t input_len,
uint8_t * output, const size_t output_len);
-extern hal_error_t hal_rsa_key_gen(const hal_core_t *core,
+extern hal_error_t hal_rsa_key_gen(hal_core_t *core,
hal_rsa_key_t **key,
void *keybuf, const size_t keybuf_len,
const unsigned key_length,
@@ -531,7 +531,7 @@ 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_key_gen(const hal_core_t *core,
+extern hal_error_t hal_ecdsa_key_gen(hal_core_t *core,
hal_ecdsa_key_t **key,
void *keybuf, const size_t keybuf_len,
const hal_curve_name_t curve);
@@ -564,12 +564,12 @@ extern hal_error_t hal_ecdsa_key_from_ecpoint(hal_ecdsa_key_t **key,
const uint8_t * const der, const size_t der_len,
const hal_curve_name_t curve);
-extern hal_error_t hal_ecdsa_sign(const hal_core_t *core,
+extern hal_error_t hal_ecdsa_sign(hal_core_t *core,
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_core_t *core,
+extern hal_error_t hal_ecdsa_verify(hal_core_t *core,
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);
diff --git a/rsa.c b/rsa.c
index 3cea42c..1aae57c 100644
--- a/rsa.c
+++ b/rsa.c
@@ -189,7 +189,7 @@ static hal_error_t unpack_fp(const fp_int * const bn, uint8_t *buffer, const siz
* wrap result back up as a bignum.
*/
-static hal_error_t modexp(const hal_core_t *core,
+static hal_error_t modexp(hal_core_t *core,
const fp_int * msg,
const fp_int * const exp,
const fp_int * const mod,
@@ -277,7 +277,7 @@ static hal_error_t modexp(const hal_core_t *core, /* ignored */
* try. Come back to this if it looks like a bottleneck.
*/
-static hal_error_t create_blinding_factors(const hal_core_t *core, const hal_rsa_key_t * const key, fp_int *bf, fp_int *ubf)
+static hal_error_t create_blinding_factors(hal_core_t *core, const hal_rsa_key_t * const key, fp_int *bf, fp_int *ubf)
{
assert(key != NULL && bf != NULL && ubf != NULL);
@@ -305,7 +305,7 @@ static hal_error_t create_blinding_factors(const hal_core_t *core, const hal_rsa
* RSA decryption via Chinese Remainder Theorem (Garner's formula).
*/
-static hal_error_t rsa_crt(const hal_core_t *core, const hal_rsa_key_t * const key, fp_int *msg, fp_int *sig)
+static hal_error_t rsa_crt(hal_core_t *core, const hal_rsa_key_t * const key, fp_int *msg, fp_int *sig)
{
assert(key != NULL && msg != NULL && sig != NULL);
@@ -376,7 +376,7 @@ static hal_error_t rsa_crt(const hal_core_t *core, const hal_rsa_key_t * const k
* to the caller.
*/
-hal_error_t hal_rsa_encrypt(const hal_core_t *core,
+hal_error_t hal_rsa_encrypt(hal_core_t *core,
const hal_rsa_key_t * const key,
const uint8_t * const input, const size_t input_len,
uint8_t * output, const size_t output_len)
@@ -401,7 +401,7 @@ hal_error_t hal_rsa_encrypt(const hal_core_t *core,
return err;
}
-hal_error_t hal_rsa_decrypt(const hal_core_t *core,
+hal_error_t hal_rsa_decrypt(hal_core_t *core,
const hal_rsa_key_t * const key,
const uint8_t * const input, const size_t input_len,
uint8_t * output, const size_t output_len)
@@ -614,7 +614,7 @@ static hal_error_t find_prime(const unsigned prime_length,
* Generate a new RSA keypair.
*/
-hal_error_t hal_rsa_key_gen(const hal_core_t *core,
+hal_error_t hal_rsa_key_gen(hal_core_t *core,
hal_rsa_key_t **key_,
void *keybuf, const size_t keybuf_len,
const unsigned key_length,