mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-10 06:23:01 +03:00
cleanup: use ssh_ prefix in the gcrypt missing functions
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@@ -52,15 +52,15 @@ typedef void *EVPCTX;
|
||||
typedef gcry_mpi_t bignum;
|
||||
|
||||
/* missing gcrypt functions */
|
||||
int my_gcry_dec2bn(bignum *bn, const char *data);
|
||||
char *my_gcry_bn2dec(bignum bn);
|
||||
int ssh_gcry_dec2bn(bignum *bn, const char *data);
|
||||
char *ssh_gcry_bn2dec(bignum bn);
|
||||
|
||||
#define bignum_new() gcry_mpi_new(0)
|
||||
#define bignum_free(num) gcry_mpi_release(num)
|
||||
#define bignum_set_word(bn,n) gcry_mpi_set_ui(bn,n)
|
||||
#define bignum_bin2bn(bn,datalen,data) gcry_mpi_scan(data,GCRYMPI_FMT_USG,bn,datalen,NULL)
|
||||
#define bignum_bn2dec(num) my_gcry_bn2dec(num)
|
||||
#define bignum_dec2bn(num, data) my_gcry_dec2bn(data, num)
|
||||
#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_hex2bn(num,datalen,data) gcry_mpi_scan(num,GCRYMPI_FMT_HEX,data,datalen,NULL)
|
||||
#define bignum_rand(num,bits) gcry_mpi_randomize(num,bits,GCRY_STRONG_RANDOM),gcry_mpi_set_bit(num,bits-1),gcry_mpi_set_bit(num,0)
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#include "libssh/libgcrypt.h"
|
||||
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
int my_gcry_dec2bn(bignum *bn, const char *data) {
|
||||
int ssh_gcry_dec2bn(bignum *bn, const char *data) {
|
||||
int count;
|
||||
|
||||
*bn = bignum_new();
|
||||
@@ -43,7 +43,7 @@ int my_gcry_dec2bn(bignum *bn, const char *data) {
|
||||
return count;
|
||||
}
|
||||
|
||||
char *my_gcry_bn2dec(bignum bn) {
|
||||
char *ssh_gcry_bn2dec(bignum bn) {
|
||||
bignum bndup, num, ten;
|
||||
char *ret;
|
||||
int count, count2;
|
||||
|
Reference in New Issue
Block a user