aboutsummaryrefslogtreecommitdiff
path: root/include/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'include/libssh')
-rw-r--r--include/libssh/bignum.h2
-rw-r--r--include/libssh/libgcrypt.h5
-rw-r--r--include/libssh/libmbedcrypto.h2
3 files changed, 6 insertions, 3 deletions
diff --git a/include/libssh/bignum.h b/include/libssh/bignum.h
index 3f82bc64..726ed7b9 100644
--- a/include/libssh/bignum.h
+++ b/include/libssh/bignum.h
@@ -27,7 +27,7 @@
bignum ssh_make_string_bn(ssh_string string);
ssh_string ssh_make_bignum_string(bignum num);
-void ssh_print_bignum(const char *which, const bignum num);
+void ssh_print_bignum(const char *which, const_bignum num);
#endif /* BIGNUM_H_ */
diff --git a/include/libssh/libgcrypt.h b/include/libssh/libgcrypt.h
index 795d33e1..347d851b 100644
--- a/include/libssh/libgcrypt.h
+++ b/include/libssh/libgcrypt.h
@@ -78,7 +78,10 @@ int ssh_gcry_rand_range(bignum rnd, bignum max);
#define bignum_bin2bn(data,datalen,dest) gcry_mpi_scan(dest,GCRYMPI_FMT_USG,data,datalen,NULL)
#define bignum_bn2dec(num) ssh_gcry_bn2dec(num)
#define bignum_dec2bn(num, data) ssh_gcry_dec2bn(data, num)
-#define bignum_bn2hex(num,data) gcry_mpi_aprint(GCRYMPI_FMT_HEX,data,NULL,num)
+
+#define bignum_bn2hex(num, data) \
+ gcry_mpi_aprint(GCRYMPI_FMT_HEX, data, NULL, (const gcry_mpi_t)num)
+
#define bignum_hex2bn(data, num) (gcry_mpi_scan(num,GCRYMPI_FMT_HEX,data,0,NULL)==0?1:0)
#define bignum_rand(num,bits) 1,gcry_mpi_randomize(num,bits,GCRY_STRONG_RANDOM),gcry_mpi_set_bit(num,bits-1),gcry_mpi_set_bit(num,0)
#define bignum_mod_exp(dest,generator,exp,modulo, ctx) 1,gcry_mpi_powm(dest,generator,exp,modulo)
diff --git a/include/libssh/libmbedcrypto.h b/include/libssh/libmbedcrypto.h
index 00d5ba8c..fe53019b 100644
--- a/include/libssh/libmbedcrypto.h
+++ b/include/libssh/libmbedcrypto.h
@@ -75,7 +75,7 @@ struct mbedtls_ecdsa_sig {
bignum ssh_mbedcry_bn_new(void);
void ssh_mbedcry_bn_free(bignum num);
-unsigned char *ssh_mbedcry_bn2num(bignum num, int radix);
+unsigned char *ssh_mbedcry_bn2num(const_bignum num, int radix);
int ssh_mbedcry_rand(bignum rnd, int bits, int top, int bottom);
int ssh_mbedcry_is_bit_set(bignum num, size_t pos);
int ssh_mbedcry_rand_range(bignum dest, bignum max);