summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/auth_anon.c8
-rw-r--r--lib/auth_dh_common.c8
-rw-r--r--lib/auth_dh_common.h4
-rw-r--r--lib/auth_dhe.c8
-rw-r--r--lib/auth_dhe_psk.c8
-rw-r--r--lib/auth_rsa.c8
-rw-r--r--lib/auth_rsa_export.c2
-rw-r--r--lib/auth_srp.c12
-rw-r--r--lib/debug.c2
-rw-r--r--lib/debug.h2
-rw-r--r--lib/gnutls_cert.h4
-rw-r--r--lib/gnutls_dh.c12
-rw-r--r--lib/gnutls_dh.h6
-rw-r--r--lib/gnutls_dh_primes.c4
-rw-r--r--lib/gnutls_int.h26
-rw-r--r--lib/gnutls_mpi.c20
-rw-r--r--lib/gnutls_mpi.h17
-rw-r--r--lib/gnutls_openpgp.c2
-rw-r--r--lib/gnutls_pk.c24
-rw-r--r--lib/gnutls_pk.h20
-rw-r--r--lib/gnutls_rsa_export.c2
-rw-r--r--lib/gnutls_rsa_export.h2
-rw-r--r--lib/gnutls_sig.c2
-rw-r--r--lib/gnutls_sig.h2
-rw-r--r--lib/gnutls_srp.c44
-rw-r--r--lib/gnutls_srp.h14
-rw-r--r--lib/gnutls_state.c6
-rw-r--r--lib/gnutls_state.h6
-rw-r--r--lib/gnutls_x509.h4
-rw-r--r--lib/mpi-libgcrypt.c42
-rw-r--r--lib/openpgp/openpgp_int.h6
-rw-r--r--lib/openpgp/pgp.c8
-rw-r--r--lib/openpgp/privkey.c6
-rw-r--r--lib/pk-libgcrypt.c24
-rw-r--r--lib/x509/common.c4
-rw-r--r--lib/x509/common.h2
-rw-r--r--lib/x509/mpi.c22
-rw-r--r--lib/x509/pkcs12_encr.c4
-rw-r--r--lib/x509/privkey.c22
-rw-r--r--lib/x509/sign.c4
-rw-r--r--lib/x509/verify.c8
-rw-r--r--lib/x509/x509.c6
-rw-r--r--lib/x509/x509_int.h26
43 files changed, 230 insertions, 233 deletions
diff --git a/lib/auth_anon.c b/lib/auth_anon.c
index e1b46df6cb..fcfe333976 100644
--- a/lib/auth_anon.c
+++ b/lib/auth_anon.c
@@ -64,8 +64,8 @@ const mod_auth_st anon_auth_struct = {
static int
gen_anon_server_kx (gnutls_session_t session, opaque ** data)
{
- mpi_t g, p;
- const mpi_t *mpis;
+ bigint_t g, p;
+ const bigint_t *mpis;
int ret;
gnutls_dh_params_t dh_params;
gnutls_anon_server_credentials_t cred;
@@ -117,9 +117,9 @@ proc_anon_client_kx (gnutls_session_t session, opaque * data,
gnutls_anon_server_credentials_t cred;
int bits;
int ret;
- mpi_t p, g;
+ bigint_t p, g;
gnutls_dh_params_t dh_params;
- const mpi_t *mpis;
+ const bigint_t *mpis;
bits = _gnutls_dh_get_allowed_prime_bits (session);
diff --git a/lib/auth_dh_common.c b/lib/auth_dh_common.c
index 224620d982..0a76c97b71 100644
--- a/lib/auth_dh_common.c
+++ b/lib/auth_dh_common.c
@@ -54,7 +54,7 @@ _gnutls_free_dh_info (dh_info_st * dh)
int
_gnutls_proc_dh_common_client_kx (gnutls_session_t session,
opaque * data, size_t _data_size,
- mpi_t g, mpi_t p)
+ bigint_t g, bigint_t p)
{
uint16_t n_Y;
size_t _n_Y;
@@ -122,7 +122,7 @@ _gnutls_proc_dh_common_client_kx (gnutls_session_t session,
int
_gnutls_gen_dh_common_client_kx (gnutls_session_t session, opaque ** data)
{
- mpi_t x = NULL, X = NULL;
+ bigint_t x = NULL, X = NULL;
size_t n_X;
int ret;
@@ -305,9 +305,9 @@ _gnutls_proc_dh_common_server_kx (gnutls_session_t session,
* be inserted */
int
_gnutls_dh_common_print_server_kx (gnutls_session_t session,
- mpi_t g, mpi_t p, opaque ** data, int psk)
+ bigint_t g, bigint_t p, opaque ** data, int psk)
{
- mpi_t x, X;
+ bigint_t x, X;
size_t n_X, n_g, n_p;
int ret, data_size, pos;
uint8_t *pdata;
diff --git a/lib/auth_dh_common.h b/lib/auth_dh_common.h
index be0ad06629..b4ec6b6a00 100644
--- a/lib/auth_dh_common.h
+++ b/lib/auth_dh_common.h
@@ -38,8 +38,8 @@ void _gnutls_free_dh_info (dh_info_st * dh);
int _gnutls_gen_dh_common_client_kx (gnutls_session_t, opaque **);
int _gnutls_proc_dh_common_client_kx (gnutls_session_t session,
opaque * data, size_t _data_size,
- mpi_t p, mpi_t g);
-int _gnutls_dh_common_print_server_kx (gnutls_session_t, mpi_t g, mpi_t p,
+ bigint_t p, bigint_t g);
+int _gnutls_dh_common_print_server_kx (gnutls_session_t, bigint_t g, bigint_t p,
opaque ** data, int psk);
int _gnutls_proc_dh_common_server_kx (gnutls_session_t session,
opaque * data, size_t _data_size,
diff --git a/lib/auth_dhe.c b/lib/auth_dhe.c
index ef10802889..ba5220d28c 100644
--- a/lib/auth_dhe.c
+++ b/lib/auth_dhe.c
@@ -81,8 +81,8 @@ const mod_auth_st dhe_dss_auth_struct = {
static int
gen_dhe_server_kx (gnutls_session_t session, opaque ** data)
{
- mpi_t g, p;
- const mpi_t *mpis;
+ bigint_t g, p;
+ const bigint_t *mpis;
int ret = 0, data_size;
int bits;
gnutls_cert *apr_cert_list;
@@ -245,8 +245,8 @@ proc_dhe_client_kx (gnutls_session_t session, opaque * data,
{
gnutls_certificate_credentials_t cred;
int ret;
- mpi_t p, g;
- const mpi_t *mpis;
+ bigint_t p, g;
+ const bigint_t *mpis;
gnutls_dh_params_t dh_params;
cred = (gnutls_certificate_credentials_t)
diff --git a/lib/auth_dhe_psk.c b/lib/auth_dhe_psk.c
index efa26bf082..0e752c2030 100644
--- a/lib/auth_dhe_psk.c
+++ b/lib/auth_dhe_psk.c
@@ -119,8 +119,8 @@ error:
static int
gen_psk_server_kx (gnutls_session_t session, opaque ** data)
{
- mpi_t g, p;
- const mpi_t *mpis;
+ bigint_t g, p;
+ const bigint_t *mpis;
int ret;
gnutls_dh_params_t dh_params;
gnutls_psk_server_credentials_t cred;
@@ -171,9 +171,9 @@ proc_psk_client_kx (gnutls_session_t session, opaque * data,
{
int bits;
int ret;
- mpi_t p, g;
+ bigint_t p, g;
gnutls_dh_params_t dh_params;
- const mpi_t *mpis;
+ const bigint_t *mpis;
gnutls_psk_server_credentials_t cred;
psk_auth_info_t info;
gnutls_datum_t username;
diff --git a/lib/auth_rsa.c b/lib/auth_rsa.c
index f8f6696332..b84dcb306e 100644
--- a/lib/auth_rsa.c
+++ b/lib/auth_rsa.c
@@ -67,7 +67,7 @@ const mod_auth_st rsa_auth_struct = {
*/
int
_gnutls_get_public_rsa_params (gnutls_session_t session,
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE],
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE],
int *params_len)
{
int ret;
@@ -147,7 +147,7 @@ _gnutls_get_public_rsa_params (gnutls_session_t session,
*/
int
_gnutls_get_private_rsa_params (gnutls_session_t session,
- mpi_t ** params, int *params_size)
+ bigint_t ** params, int *params_size)
{
int bits;
gnutls_certificate_credentials_t cred;
@@ -211,7 +211,7 @@ _gnutls_proc_rsa_client_kx (gnutls_session_t session, opaque * data,
gnutls_datum_t plaintext;
gnutls_datum_t ciphertext;
int ret, dsize;
- mpi_t *params;
+ bigint_t *params;
int params_len;
int randomize_key = 0;
ssize_t data_size = _data_size;
@@ -322,7 +322,7 @@ _gnutls_gen_rsa_client_kx (gnutls_session_t session, opaque ** data)
{
cert_auth_info_t auth = session->key->auth_info;
gnutls_datum_t sdata; /* data to send */
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_len = MAX_PUBLIC_PARAMS_SIZE;
int ret, i;
gnutls_protocol_t ver;
diff --git a/lib/auth_rsa_export.c b/lib/auth_rsa_export.c
index 375530f7b4..3b4b24c045 100644
--- a/lib/auth_rsa_export.c
+++ b/lib/auth_rsa_export.c
@@ -69,7 +69,7 @@ static int
gen_rsa_export_server_kx (gnutls_session_t session, opaque ** data)
{
gnutls_rsa_params_t rsa_params;
- const mpi_t *rsa_mpis;
+ const bigint_t *rsa_mpis;
size_t n_e, n_m;
uint8_t *data_e, *data_m;
int ret = 0, data_size;
diff --git a/lib/auth_srp.c b/lib/auth_srp.c
index 168675094b..d438a163b8 100644
--- a/lib/auth_srp.c
+++ b/lib/auth_srp.c
@@ -75,10 +75,10 @@ const mod_auth_st srp_auth_struct = {
* all are ok.
*/
inline static int
-check_b_mod_n (mpi_t b, mpi_t n)
+check_b_mod_n (bigint_t b, bigint_t n)
{
int ret;
- mpi_t r;
+ bigint_t r;
r = _gnutls_mpi_mod (b, n);
@@ -106,10 +106,10 @@ check_b_mod_n (mpi_t b, mpi_t n)
* all are ok.
*/
inline static int
-check_a_mod_n (mpi_t a, mpi_t n)
+check_a_mod_n (bigint_t a, bigint_t n)
{
int ret;
- mpi_t r;
+ bigint_t r;
r = _gnutls_mpi_mod (a, n);
if (r == NULL)
@@ -598,9 +598,9 @@ check_g_n (const opaque * g, size_t n_g, const opaque * n, size_t n_n)
* Otherwise only the included parameters must be used.
*/
static int
-group_check_g_n (mpi_t g, mpi_t n)
+group_check_g_n (bigint_t g, bigint_t n)
{
- mpi_t q = NULL, two = NULL, w = NULL;
+ bigint_t q = NULL, two = NULL, w = NULL;
int ret;
if (_gnutls_mpi_get_nbits (n) < 2048)
diff --git a/lib/debug.c b/lib/debug.c
index b932e94c34..e63e8b019e 100644
--- a/lib/debug.c
+++ b/lib/debug.c
@@ -117,7 +117,7 @@ _gnutls_handshake2str (gnutls_handshake_description_t handshake)
}
void
-_gnutls_dump_mpi (const char *prefix, mpi_t a)
+_gnutls_dump_mpi (const char *prefix, bigint_t a)
{
opaque mpi_buf[1024];
opaque buf[1024];
diff --git a/lib/debug.h b/lib/debug.h
index 169bc21d9e..6832ed7284 100644
--- a/lib/debug.h
+++ b/lib/debug.h
@@ -27,4 +27,4 @@ void _gnutls_print_state (gnutls_session_t session);
#endif
const char *_gnutls_packet2str (content_type_t packet);
const char *_gnutls_handshake2str (gnutls_handshake_description_t handshake);
-void _gnutls_dump_mpi (const char *prefix, mpi_t a);
+void _gnutls_dump_mpi (const char *prefix, bigint_t a);
diff --git a/lib/gnutls_cert.h b/lib/gnutls_cert.h
index 426554cc89..b7c80b59a6 100644
--- a/lib/gnutls_cert.h
+++ b/lib/gnutls_cert.h
@@ -51,7 +51,7 @@
typedef struct gnutls_cert
{
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE]; /* the size of params depends on the public
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE]; /* the size of params depends on the public
* key algorithm
* RSA: [0] is modulus
* [1] is public exponent
@@ -82,7 +82,7 @@ typedef struct gnutls_cert
typedef struct gnutls_privkey_int
{
- mpi_t params[MAX_PRIV_PARAMS_SIZE]; /* the size of params depends on the public
+ bigint_t params[MAX_PRIV_PARAMS_SIZE]; /* the size of params depends on the public
* key algorithm
*/
/*
diff --git a/lib/gnutls_dh.c b/lib/gnutls_dh.c
index c1db270947..1ceb8f203f 100644
--- a/lib/gnutls_dh.c
+++ b/lib/gnutls_dh.c
@@ -46,10 +46,10 @@
/* returns the public value (X), and the secret (ret_x).
*/
-mpi_t
-gnutls_calc_dh_secret (mpi_t * ret_x, mpi_t g, mpi_t prime)
+bigint_t
+gnutls_calc_dh_secret (bigint_t * ret_x, bigint_t g, bigint_t prime)
{
- mpi_t e, x = NULL;
+ bigint_t e, x = NULL;
int x_size = _gnutls_mpi_get_nbits (prime) - 1;
/* The size of the secret key is less than
* prime/2
@@ -89,10 +89,10 @@ gnutls_calc_dh_secret (mpi_t * ret_x, mpi_t g, mpi_t prime)
}
-mpi_t
-gnutls_calc_dh_key (mpi_t f, mpi_t x, mpi_t prime)
+bigint_t
+gnutls_calc_dh_key (bigint_t f, bigint_t x, bigint_t prime)
{
- mpi_t k;
+ bigint_t k;
int bits;
bits = _gnutls_mpi_get_nbits (prime);
diff --git a/lib/gnutls_dh.h b/lib/gnutls_dh.h
index dff6320d31..d9ab4153a6 100644
--- a/lib/gnutls_dh.h
+++ b/lib/gnutls_dh.h
@@ -25,9 +25,9 @@
#ifndef GNUTLS_DH_H
# define GNUTLS_DH_H
-const mpi_t *_gnutls_dh_params_to_mpi (gnutls_dh_params_t);
-mpi_t gnutls_calc_dh_secret (mpi_t * ret_x, mpi_t g, mpi_t prime);
-mpi_t gnutls_calc_dh_key (mpi_t f, mpi_t x, mpi_t prime);
+const bigint_t *_gnutls_dh_params_to_mpi (gnutls_dh_params_t);
+bigint_t gnutls_calc_dh_secret (bigint_t * ret_x, bigint_t g, bigint_t prime);
+bigint_t gnutls_calc_dh_key (bigint_t f, bigint_t x, bigint_t prime);
gnutls_dh_params_t
_gnutls_get_dh_params (gnutls_dh_params_t dh_params,
diff --git a/lib/gnutls_dh_primes.c b/lib/gnutls_dh_primes.c
index 7c03da1c07..609c83f6e9 100644
--- a/lib/gnutls_dh_primes.c
+++ b/lib/gnutls_dh_primes.c
@@ -36,7 +36,7 @@
/* returns the prime and the generator of DH params.
*/
-const mpi_t *
+const bigint_t *
_gnutls_dh_params_to_mpi (gnutls_dh_params_t dh_primes)
{
if (dh_primes == NULL || dh_primes->params[1] == NULL ||
@@ -68,7 +68,7 @@ gnutls_dh_params_import_raw (gnutls_dh_params_t dh_params,
const gnutls_datum_t * prime,
const gnutls_datum_t * generator)
{
- mpi_t tmp_prime, tmp_g;
+ bigint_t tmp_prime, tmp_g;
size_t siz;
siz = prime->size;
diff --git a/lib/gnutls_int.h b/lib/gnutls_int.h
index e37237d33c..35423e4ffe 100644
--- a/lib/gnutls_int.h
+++ b/lib/gnutls_int.h
@@ -189,21 +189,21 @@ struct gnutls_key_st
{
/* For DH KX */
gnutls_datum_t key;
- mpi_t KEY;
- mpi_t client_Y;
- mpi_t client_g;
- mpi_t client_p;
- mpi_t dh_secret;
+ bigint_t KEY;
+ bigint_t client_Y;
+ bigint_t client_g;
+ bigint_t client_p;
+ bigint_t dh_secret;
/* for SRP */
- mpi_t A;
- mpi_t B;
- mpi_t u;
- mpi_t b;
- mpi_t a;
- mpi_t x;
+ bigint_t A;
+ bigint_t B;
+ bigint_t u;
+ bigint_t b;
+ bigint_t a;
+ bigint_t x;
/* RSA: e, m
*/
- mpi_t rsa[2];
+ bigint_t rsa[2];
/* this is used to hold the peers authentication data
*/
@@ -409,7 +409,7 @@ typedef struct gnutls_dh_params_int
{
/* [0] is the prime, [1] is the generator.
*/
- mpi_t params[2];
+ bigint_t params[2];
} dh_params_st;
typedef struct
diff --git a/lib/gnutls_mpi.c b/lib/gnutls_mpi.c
index 7a0f122d8b..2f7234e0b2 100644
--- a/lib/gnutls_mpi.c
+++ b/lib/gnutls_mpi.c
@@ -39,12 +39,12 @@
#define clearbit(v,n) ((unsigned char)(v) & ~( (unsigned char)(1) << (unsigned)(n)))
/* FIXME: test this function */
-mpi_t _gnutls_mpi_randomize( mpi_t r, unsigned int bits, gnutls_rnd_level_t level)
+bigint_t _gnutls_mpi_randomize( bigint_t r, unsigned int bits, gnutls_rnd_level_t level)
{
opaque * buf = NULL;
int size = 1+(bits/8), ret;
int rem, i;
-mpi_t tmp;
+bigint_t tmp;
buf = gnutls_malloc( size);
if (buf == NULL)
@@ -92,7 +92,7 @@ cleanup:
}
void
-_gnutls_mpi_release (mpi_t * x)
+_gnutls_mpi_release (bigint_t * x)
{
if (*x == NULL)
return;
@@ -104,7 +104,7 @@ _gnutls_mpi_release (mpi_t * x)
/* returns zero on success
*/
int
-_gnutls_mpi_scan (mpi_t * ret_mpi, const void * buffer, size_t nbytes)
+_gnutls_mpi_scan (bigint_t * ret_mpi, const void * buffer, size_t nbytes)
{
*ret_mpi = _gnutls_mpi_ops.bigint_scan (buffer, nbytes, GNUTLS_MPI_FORMAT_USG);
if (*ret_mpi == NULL)
@@ -119,7 +119,7 @@ _gnutls_mpi_scan (mpi_t * ret_mpi, const void * buffer, size_t nbytes)
/* returns zero on success. Fails if the number is zero.
*/
int
-_gnutls_mpi_scan_nz (mpi_t *ret_mpi, const void * buffer, size_t nbytes)
+_gnutls_mpi_scan_nz (bigint_t *ret_mpi, const void * buffer, size_t nbytes)
{
int ret;
@@ -141,7 +141,7 @@ int ret;
/* Always has the first bit zero */
int
-_gnutls_mpi_dprint_lz (const mpi_t a, gnutls_datum_t * dest)
+_gnutls_mpi_dprint_lz (const bigint_t a, gnutls_datum_t * dest)
{
int ret;
opaque *buf = NULL;
@@ -170,7 +170,7 @@ _gnutls_mpi_dprint_lz (const mpi_t a, gnutls_datum_t * dest)
}
int
-_gnutls_mpi_dprint (const mpi_t a, gnutls_datum_t * dest)
+_gnutls_mpi_dprint (const bigint_t a, gnutls_datum_t * dest)
{
int ret;
opaque *buf = NULL;
@@ -202,7 +202,7 @@ _gnutls_mpi_dprint (const mpi_t a, gnutls_datum_t * dest)
* the output value is left padded with zeros.
*/
int
-_gnutls_mpi_dprint_size (const mpi_t a, gnutls_datum_t * dest, size_t size)
+_gnutls_mpi_dprint_size (const bigint_t a, gnutls_datum_t * dest, size_t size)
{
int ret;
opaque *buf = NULL;
@@ -245,7 +245,7 @@ _gnutls_mpi_dprint_size (const mpi_t a, gnutls_datum_t * dest, size_t size)
* steps.
*/
int
-_gnutls_x509_read_int (ASN1_TYPE node, const char *value, mpi_t * ret_mpi)
+_gnutls_x509_read_int (ASN1_TYPE node, const char *value, bigint_t * ret_mpi)
{
int result;
opaque *tmpstr = NULL;
@@ -289,7 +289,7 @@ _gnutls_x509_read_int (ASN1_TYPE node, const char *value, mpi_t * ret_mpi)
/* Writes the specified integer into the specified node.
*/
int
-_gnutls_x509_write_int (ASN1_TYPE node, const char *value, mpi_t mpi, int lz)
+_gnutls_x509_write_int (ASN1_TYPE node, const char *value, bigint_t mpi, int lz)
{
opaque *tmpstr;
size_t s_len;
diff --git a/lib/gnutls_mpi.h b/lib/gnutls_mpi.h
index c02d55790f..3978946ebf 100644
--- a/lib/gnutls_mpi.h
+++ b/lib/gnutls_mpi.h
@@ -26,7 +26,6 @@
# define GNUTLS_MPI_H
# include <gnutls_int.h>
-# include <gc.h>
# include <libtasn1.h>
# include <gnutls/crypto.h>
@@ -34,9 +33,7 @@
extern int crypto_bigint_prio;
extern gnutls_crypto_bigint_st _gnutls_mpi_ops;
-typedef bigint_t mpi_t;
-
-mpi_t _gnutls_mpi_randomize( mpi_t, unsigned int bits, gnutls_rnd_level_t level);
+bigint_t _gnutls_mpi_randomize( bigint_t, unsigned int bits, gnutls_rnd_level_t level);
#define _gnutls_mpi_new(x) _gnutls_mpi_ops.bigint_new(x)
#define _gnutls_mpi_cmp(x,y) _gnutls_mpi_ops.bigint_cmp(x,y)
@@ -62,14 +59,14 @@ mpi_t _gnutls_mpi_randomize( mpi_t, unsigned int bits, gnutls_rnd_level_t level)
#define _gnutls_mpi_print_lz(x,y,z) _gnutls_mpi_ops.bigint_print(x,y,z,GNUTLS_MPI_FORMAT_STD)
#define _gnutls_mpi_copy( a) _gnutls_mpi_set( NULL, a)
-void _gnutls_mpi_release (mpi_t * x);
+void _gnutls_mpi_release (bigint_t * x);
-int _gnutls_mpi_scan (mpi_t * ret_mpi, const void * buffer, size_t nbytes);
-int _gnutls_mpi_scan_nz (mpi_t * ret_mpi, const void * buffer, size_t nbytes);
+int _gnutls_mpi_scan (bigint_t * ret_mpi, const void * buffer, size_t nbytes);
+int _gnutls_mpi_scan_nz (bigint_t * ret_mpi, const void * buffer, size_t nbytes);
-int _gnutls_mpi_dprint_lz ( const mpi_t a, gnutls_datum_t * dest);
-int _gnutls_mpi_dprint ( const mpi_t a, gnutls_datum_t * dest);
-int _gnutls_mpi_dprint_size (const mpi_t a, gnutls_datum_t * dest, size_t size);
+int _gnutls_mpi_dprint_lz ( const bigint_t a, gnutls_datum_t * dest);
+int _gnutls_mpi_dprint ( const bigint_t a, gnutls_datum_t * dest);
+int _gnutls_mpi_dprint_size (const bigint_t a, gnutls_datum_t * dest, size_t size);
#define _gnutls_mpi_generate_group( gg, bits) _gnutls_mpi_ops.bigint_generate_group( gg, bits)
diff --git a/lib/gnutls_openpgp.c b/lib/gnutls_openpgp.c
index 4a2ef7bc8b..6d293b9af1 100644
--- a/lib/gnutls_openpgp.c
+++ b/lib/gnutls_openpgp.c
@@ -888,7 +888,7 @@ gnutls_openpgp_privkey_sign_hash (gnutls_openpgp_privkey_t key,
gnutls_datum_t * signature)
{
int result, i;
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
int pk_algorithm;
gnutls_openpgp_keyid_t keyid;
diff --git a/lib/gnutls_pk.c b/lib/gnutls_pk.c
index 38acbb33b5..8794207382 100644
--- a/lib/gnutls_pk.c
+++ b/lib/gnutls_pk.c
@@ -44,7 +44,7 @@
int
_gnutls_pkcs1_rsa_encrypt (gnutls_datum_t * ciphertext,
const gnutls_datum_t * plaintext,
- mpi_t * params, unsigned params_len,
+ bigint_t * params, unsigned params_len,
unsigned btype)
{
unsigned int i, pad;
@@ -204,7 +204,7 @@ _gnutls_pkcs1_rsa_encrypt (gnutls_datum_t * ciphertext,
int
_gnutls_pkcs1_rsa_decrypt (gnutls_datum_t * plaintext,
const gnutls_datum_t * ciphertext,
- mpi_t * params, unsigned params_len,
+ bigint_t * params, unsigned params_len,
unsigned btype)
{
unsigned k, i;
@@ -314,7 +314,7 @@ _gnutls_pkcs1_rsa_decrypt (gnutls_datum_t * plaintext,
int
_gnutls_rsa_verify (const gnutls_datum_t * vdata,
- const gnutls_datum_t * ciphertext, mpi_t * params,
+ const gnutls_datum_t * ciphertext, bigint_t * params,
int params_len, int btype)
{
@@ -352,7 +352,7 @@ _gnutls_rsa_verify (const gnutls_datum_t * vdata,
/* encodes the Dss-Sig-Value structure
*/
int
-_gnutls_encode_ber_rs (gnutls_datum_t * sig_value, mpi_t r, mpi_t s)
+_gnutls_encode_ber_rs (gnutls_datum_t * sig_value, bigint_t r, bigint_t s)
{
ASN1_TYPE sig;
int result, tot_len;
@@ -402,7 +402,7 @@ _gnutls_encode_ber_rs (gnutls_datum_t * sig_value, mpi_t r, mpi_t s)
*/
int
_gnutls_dsa_sign (gnutls_datum_t * signature,
- const gnutls_datum_t * hash, mpi_t * params,
+ const gnutls_datum_t * hash, bigint_t * params,
unsigned params_len)
{
int ret;
@@ -434,7 +434,7 @@ _gnutls_dsa_sign (gnutls_datum_t * signature,
/* decodes the Dss-Sig-Value structure
*/
int
-_gnutls_decode_ber_rs (const gnutls_datum_t * sig_value, mpi_t * r, mpi_t * s)
+_gnutls_decode_ber_rs (const gnutls_datum_t * sig_value, bigint_t * r, bigint_t * s)
{
ASN1_TYPE sig;
int result;
@@ -482,7 +482,7 @@ _gnutls_decode_ber_rs (const gnutls_datum_t * sig_value, mpi_t * r, mpi_t * s)
*/
int
_gnutls_dsa_verify (const gnutls_datum_t * vdata,
- const gnutls_datum_t * sig_value, mpi_t * params,
+ const gnutls_datum_t * sig_value, bigint_t * params,
int params_len)
{
@@ -512,7 +512,7 @@ _gnutls_dsa_verify (const gnutls_datum_t * vdata,
/* some generic pk functions */
static
-int _generate_params(int algo, mpi_t * resarr, unsigned int *resarr_len, int bits)
+int _generate_params(int algo, bigint_t * resarr, unsigned int *resarr_len, int bits)
{
gnutls_pk_params_st params;
int ret;
@@ -538,22 +538,22 @@ unsigned int i;
-int _gnutls_rsa_generate_params (mpi_t * resarr, unsigned int *resarr_len, int bits)
+int _gnutls_rsa_generate_params (bigint_t * resarr, unsigned int *resarr_len, int bits)
{
return _generate_params( GNUTLS_PK_RSA, resarr, resarr_len, bits);
}
-int _gnutls_dsa_generate_params (mpi_t * resarr, unsigned int *resarr_len, int bits)
+int _gnutls_dsa_generate_params (bigint_t * resarr, unsigned int *resarr_len, int bits)
{
return _generate_params( GNUTLS_PK_DSA, resarr, resarr_len, bits);
}
-int _gnutls_pk_params_copy( gnutls_pk_params_st* dst, mpi_t* params, int params_len)
+int _gnutls_pk_params_copy( gnutls_pk_params_st* dst, bigint_t* params, int params_len)
{
int i,j;
dst->params_nr = 0;
- dst->params = gnutls_malloc( sizeof(mpi_t)*params_len);
+ dst->params = gnutls_malloc( sizeof(bigint_t)*params_len);
if (dst->params == NULL) {
gnutls_assert();
return GNUTLS_E_MEMORY_ERROR;
diff --git a/lib/gnutls_pk.h b/lib/gnutls_pk.h
index 890b7e5b19..c145a5e0f3 100644
--- a/lib/gnutls_pk.h
+++ b/lib/gnutls_pk.h
@@ -40,36 +40,36 @@ _gnutls_pk_fixup( gnutls_pk_algorithm_t algo, gnutls_direction_t direction, gnut
return 0;
}
-int _gnutls_pk_params_copy( gnutls_pk_params_st* dst, mpi_t* params, int params_len);
+int _gnutls_pk_params_copy( gnutls_pk_params_st* dst, bigint_t* params, int params_len);
void gnutls_pk_params_release( gnutls_pk_params_st* p);
void gnutls_pk_params_init( gnutls_pk_params_st* p);
-int _gnutls_rsa_generate_params (mpi_t * resarr, unsigned int *resarr_len, int bits);
-int _gnutls_dsa_generate_params (mpi_t * resarr, unsigned int *resarr_len, int bits);
+int _gnutls_rsa_generate_params (bigint_t * resarr, unsigned int *resarr_len, int bits);
+int _gnutls_dsa_generate_params (bigint_t * resarr, unsigned int *resarr_len, int bits);
/* The internal PK interface */
int _gnutls_pkcs1_rsa_encrypt (gnutls_datum_t * ciphertext,
const gnutls_datum_t * plaintext,
- mpi_t * params, unsigned params_len,
+ bigint_t * params, unsigned params_len,
unsigned btype);
int _gnutls_dsa_sign (gnutls_datum_t * signature,
- const gnutls_datum_t * plaintext, mpi_t * params,
+ const gnutls_datum_t * plaintext, bigint_t * params,
unsigned params_len);
int _gnutls_pkcs1_rsa_decrypt (gnutls_datum_t * plaintext,
const gnutls_datum_t * ciphertext,
- mpi_t * params, unsigned params_len,
+ bigint_t * params, unsigned params_len,
unsigned btype);
int _gnutls_rsa_verify (const gnutls_datum_t * vdata,
- const gnutls_datum_t * ciphertext, mpi_t * params,
+ const gnutls_datum_t * ciphertext, bigint_t * params,
int params_len, int btype);
int _gnutls_dsa_verify (const gnutls_datum_t * vdata,
- const gnutls_datum_t * sig_value, mpi_t * params,
+ const gnutls_datum_t * sig_value, bigint_t * params,
int params_len);
int
-_gnutls_encode_ber_rs (gnutls_datum_t * sig_value, mpi_t r, mpi_t s);
+_gnutls_encode_ber_rs (gnutls_datum_t * sig_value, bigint_t r, bigint_t s);
int
-_gnutls_decode_ber_rs (const gnutls_datum_t * sig_value, mpi_t * r, mpi_t * s);
+_gnutls_decode_ber_rs (const gnutls_datum_t * sig_value, bigint_t * r, bigint_t * s);
#endif /* GNUTLS_PK_H */
diff --git a/lib/gnutls_rsa_export.c b/lib/gnutls_rsa_export.c
index b8f50b5fce..1ea83b7803 100644
--- a/lib/gnutls_rsa_export.c
+++ b/lib/gnutls_rsa_export.c
@@ -43,7 +43,7 @@
/* returns e and m, depends on the requested bits.
* We only support limited key sizes.
*/
-const mpi_t *
+const bigint_t *
_gnutls_rsa_params_to_mpi (gnutls_rsa_params_t rsa_params)
{
if (rsa_params == NULL)
diff --git a/lib/gnutls_rsa_export.h b/lib/gnutls_rsa_export.h
index 57f661393b..4fb85ea14d 100644
--- a/lib/gnutls_rsa_export.h
+++ b/lib/gnutls_rsa_export.h
@@ -22,5 +22,5 @@
*
*/
-const mpi_t *_gnutls_rsa_params_to_mpi (gnutls_rsa_params_t);
+const bigint_t *_gnutls_rsa_params_to_mpi (gnutls_rsa_params_t);
int _gnutls_peers_cert_less_512 (gnutls_session_t session);
diff --git a/lib/gnutls_sig.c b/lib/gnutls_sig.c
index 1c931e8a56..e62d43fe02 100644
--- a/lib/gnutls_sig.c
+++ b/lib/gnutls_sig.c
@@ -219,7 +219,7 @@ _gnutls_tls_sign_params (gnutls_session_t session, gnutls_cert * cert,
* given data. The output will be allocated and be put in signature.
*/
int
-_gnutls_sign (gnutls_pk_algorithm_t algo, mpi_t * params,
+_gnutls_sign (gnutls_pk_algorithm_t algo, bigint_t * params,
int params_size, const gnutls_datum_t * data,
gnutls_datum_t * signature)
{
diff --git a/lib/gnutls_sig.h b/lib/gnutls_sig.h
index 4d77071624..f16114c7f2 100644
--- a/lib/gnutls_sig.h
+++ b/lib/gnutls_sig.h
@@ -45,7 +45,7 @@ int _gnutls_verify_sig_params (gnutls_session_t session,
gnutls_datum_t * signature);
int _gnutls_sign (gnutls_pk_algorithm_t algo,
- mpi_t * params, int params_size,
+ bigint_t * params, int params_size,
const gnutls_datum_t * data, gnutls_datum_t * signature);
#endif
diff --git a/lib/gnutls_srp.c b/lib/gnutls_srp.c
index 2e6f698d16..35df9dceea 100644
--- a/lib/gnutls_srp.c
+++ b/lib/gnutls_srp.c
@@ -43,9 +43,9 @@
int
_gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
- mpi_t g, mpi_t prime, gnutls_alloc_function galloc_func)
+ bigint_t g, bigint_t prime, gnutls_alloc_function galloc_func)
{
- mpi_t x, e;
+ bigint_t x, e;
size_t result_size;
if (_gnutls_mpi_scan_nz (&x, text, textsize))
@@ -88,11 +88,11 @@ _gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
* where k == SHA1(N|g)
* Return: B and if ret_b is not NULL b.
*/
-mpi_t
-_gnutls_calc_srp_B (mpi_t * ret_b, mpi_t g, mpi_t n, mpi_t v)
+bigint_t
+_gnutls_calc_srp_B (bigint_t * ret_b, bigint_t g, bigint_t n, bigint_t v)
{
- mpi_t tmpB = NULL, tmpV = NULL;
- mpi_t b = NULL, B = NULL, k = NULL;
+ bigint_t tmpB = NULL, tmpV = NULL;
+ bigint_t b = NULL, B = NULL, k = NULL;
int bits;
@@ -160,15 +160,15 @@ error:
/* This calculates the SHA1(A | B)
* A and B will be left-padded with zeros to fill n_size.
*/
-mpi_t
-_gnutls_calc_srp_u (mpi_t A, mpi_t B, mpi_t n)
+bigint_t
+_gnutls_calc_srp_u (bigint_t A, bigint_t B, bigint_t n)
{
size_t b_size, a_size;
opaque *holder, hd[MAX_HASH_SIZE];
size_t holder_size, hash_size, n_size;
digest_hd_st td;
int ret;
- mpi_t res;
+ bigint_t res;
/* get the size of n in bytes */
_gnutls_mpi_print (n, NULL, &n_size);
@@ -219,11 +219,11 @@ _gnutls_calc_srp_u (mpi_t A, mpi_t B, mpi_t n)
/* S = (A * v^u) ^ b % N
* this is our shared key (server premaster secret)
*/
-mpi_t
-_gnutls_calc_srp_S1 (mpi_t A, mpi_t b, mpi_t u, mpi_t v, mpi_t n)
+bigint_t
+_gnutls_calc_srp_S1 (bigint_t A, bigint_t b, bigint_t u, bigint_t v, bigint_t n)
{
- mpi_t tmp1 = NULL, tmp2 = NULL;
- mpi_t S = NULL;
+ bigint_t tmp1 = NULL, tmp2 = NULL;
+ bigint_t S = NULL;
S = _gnutls_mpi_alloc_like (n);
if (S == NULL)
@@ -253,11 +253,11 @@ freeall:
/* A = g^a % N
* returns A and a (which is random)
*/
-mpi_t
-_gnutls_calc_srp_A (mpi_t * a, mpi_t g, mpi_t n)
+bigint_t
+_gnutls_calc_srp_A (bigint_t * a, bigint_t g, bigint_t n)
{
- mpi_t tmpa;
- mpi_t A;
+ bigint_t tmpa;
+ bigint_t A;
int bits;
bits = _gnutls_mpi_get_nbits (n);
@@ -332,11 +332,11 @@ _gnutls_calc_srp_x (char *username, char *password, opaque * salt,
/* S = (B - k*g^x) ^ (a + u * x) % N
* this is our shared key (client premaster secret)
*/
-mpi_t
-_gnutls_calc_srp_S2 (mpi_t B, mpi_t g, mpi_t x, mpi_t a, mpi_t u, mpi_t n)
+bigint_t
+_gnutls_calc_srp_S2 (bigint_t B, bigint_t g, bigint_t x, bigint_t a, bigint_t u, bigint_t n)
{
- mpi_t S = NULL, tmp1 = NULL, tmp2 = NULL;
- mpi_t tmp4 = NULL, tmp3 = NULL, k = NULL;
+ bigint_t S = NULL, tmp1 = NULL, tmp2 = NULL;
+ bigint_t tmp4 = NULL, tmp3 = NULL, k = NULL;
S = _gnutls_mpi_alloc_like (n);
if (S == NULL)
@@ -683,7 +683,7 @@ gnutls_srp_verifier (const char *username, const char *password,
const gnutls_datum_t * generator,
const gnutls_datum_t * prime, gnutls_datum_t * res)
{
- mpi_t _n, _g;
+ bigint_t _n, _g;
int ret;
size_t digest_size = 20, size;
opaque digest[20];
diff --git a/lib/gnutls_srp.h b/lib/gnutls_srp.h
index 1bf36e9432..7cf2c14b5c 100644
--- a/lib/gnutls_srp.h
+++ b/lib/gnutls_srp.h
@@ -25,13 +25,13 @@
#ifdef ENABLE_SRP
int _gnutls_srp_gx (opaque * text, size_t textsize, opaque ** result,
- mpi_t g, mpi_t prime, gnutls_alloc_function);
-mpi_t _gnutls_calc_srp_B (mpi_t * ret_b, mpi_t g, mpi_t n, mpi_t v);
-mpi_t _gnutls_calc_srp_u (mpi_t A, mpi_t B, mpi_t N);
-mpi_t _gnutls_calc_srp_S1 (mpi_t A, mpi_t b, mpi_t u, mpi_t v, mpi_t n);
-mpi_t _gnutls_calc_srp_A (mpi_t * a, mpi_t g, mpi_t n);
-mpi_t _gnutls_calc_srp_S2 (mpi_t B, mpi_t g, mpi_t x, mpi_t a, mpi_t u,
- mpi_t n);
+ bigint_t g, bigint_t prime, gnutls_alloc_function);
+bigint_t _gnutls_calc_srp_B (bigint_t * ret_b, bigint_t g, bigint_t n, bigint_t v);
+bigint_t _gnutls_calc_srp_u (bigint_t A, bigint_t B, bigint_t N);
+bigint_t _gnutls_calc_srp_S1 (bigint_t A, bigint_t b, bigint_t u, bigint_t v, bigint_t n);
+bigint_t _gnutls_calc_srp_A (bigint_t * a, bigint_t g, bigint_t n);
+bigint_t _gnutls_calc_srp_S2 (bigint_t B, bigint_t g, bigint_t x, bigint_t a, bigint_t u,
+ bigint_t n);
int _gnutls_calc_srp_x (char *username, char *password, opaque * salt,
size_t salt_size, size_t * size, void *digest);
int _gnutls_srp_gn (opaque ** ret_g, opaque ** ret_n, int bits);
diff --git a/lib/gnutls_state.c b/lib/gnutls_state.c
index b5b191f26c..2d6469d95d 100644
--- a/lib/gnutls_state.c
+++ b/lib/gnutls_state.c
@@ -438,7 +438,7 @@ _gnutls_dh_get_allowed_prime_bits (gnutls_session_t session)
}
int
-_gnutls_dh_set_peer_public (gnutls_session_t session, mpi_t public)
+_gnutls_dh_set_peer_public (gnutls_session_t session, bigint_t public)
{
dh_info_st *dh;
int ret;
@@ -538,7 +538,7 @@ _gnutls_dh_set_secret_bits (gnutls_session_t session, unsigned bits)
*/
int
_gnutls_rsa_export_set_pubkey (gnutls_session_t session,
- mpi_t exponent, mpi_t modulus)
+ bigint_t exponent, bigint_t modulus)
{
cert_auth_info_t info;
int ret;
@@ -569,7 +569,7 @@ _gnutls_rsa_export_set_pubkey (gnutls_session_t session,
/* Sets the prime and the generator in the auth info structure.
*/
int
-_gnutls_dh_set_group (gnutls_session_t session, mpi_t gen, mpi_t prime)
+_gnutls_dh_set_group (gnutls_session_t session, bigint_t gen, bigint_t prime)
{
dh_info_st *dh;
int ret;
diff --git a/lib/gnutls_state.h b/lib/gnutls_state.h
index 7a920ee450..dbd677c95d 100644
--- a/lib/gnutls_state.h
+++ b/lib/gnutls_state.h
@@ -47,14 +47,14 @@ int _gnutls_session_cert_type_supported (gnutls_session_t,
int _gnutls_dh_set_secret_bits (gnutls_session_t session, unsigned bits);
-int _gnutls_dh_set_peer_public (gnutls_session_t session, mpi_t public);
-int _gnutls_dh_set_group (gnutls_session_t session, mpi_t gen, mpi_t prime);
+int _gnutls_dh_set_peer_public (gnutls_session_t session, bigint_t public);
+int _gnutls_dh_set_group (gnutls_session_t session, bigint_t gen, bigint_t prime);
int _gnutls_dh_get_allowed_prime_bits (gnutls_session_t session);
void _gnutls_handshake_internal_state_clear (gnutls_session_t);
int _gnutls_rsa_export_set_pubkey (gnutls_session_t session,
- mpi_t exponent, mpi_t modulus);
+ bigint_t exponent, bigint_t modulus);
int _gnutls_session_is_resumable (gnutls_session_t session);
int _gnutls_session_is_export (gnutls_session_t session);
diff --git a/lib/gnutls_x509.h b/lib/gnutls_x509.h
index 3aa0d915f8..9db8f99b11 100644
--- a/lib/gnutls_x509.h
+++ b/lib/gnutls_x509.h
@@ -39,8 +39,8 @@ int _gnutls_x509_cert_verify_peers (gnutls_session_t session,
int _gnutls_check_key_usage (const gnutls_cert * cert,
gnutls_kx_algorithm_t alg);
-int _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params);
-int _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, mpi_t * params);
+int _gnutls_x509_read_rsa_params (opaque * der, int dersize, bigint_t * params);
+int _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, bigint_t * params);
int _gnutls_x509_raw_privkey_to_gkey (gnutls_privkey * privkey,
const gnutls_datum_t * raw_key,
diff --git a/lib/mpi-libgcrypt.c b/lib/mpi-libgcrypt.c
index f1fd7dd115..626c8341dc 100644
--- a/lib/mpi-libgcrypt.c
+++ b/lib/mpi-libgcrypt.c
@@ -38,10 +38,10 @@
/* returns zero on success
*/
-mpi_t
+bigint_t
wrap_gcry_mpi_scan (const void * buffer, size_t nbytes, gnutls_bigint_format_t format)
{
- gcry_mpi_t ret_mpi = NULL;
+ gcry_bigint_t ret_mpi = NULL;
int ret;
ret = gcry_mpi_scan (&ret_mpi, (format==GNUTLS_MPI_FORMAT_USG)?GCRYMPI_FMT_USG:GCRYMPI_FMT_STD, buffer, nbytes, NULL);
@@ -52,7 +52,7 @@ wrap_gcry_mpi_scan (const void * buffer, size_t nbytes, gnutls_bigint_format_t f
}
int
-wrap_gcry_mpi_print (const mpi_t a, void *buffer, size_t * nbytes, gnutls_bigint_format_t format)
+wrap_gcry_mpi_print (const bigint_t a, void *buffer, size_t * nbytes, gnutls_bigint_format_t format)
{
int ret;
@@ -74,9 +74,9 @@ wrap_gcry_mpi_print (const mpi_t a, void *buffer, size_t * nbytes, gnutls_bigint
#undef _gnutls_mpi_alloc_like
#define _gnutls_mpi_alloc_like(x) gcry_mpi_new(gcry_mpi_get_nbits(x))
-mpi_t wrap_gcry_mpi_mod( const mpi_t a, const mpi_t b)
+bigint_t wrap_gcry_mpi_mod( const bigint_t a, const bigint_t b)
{
- mpi_t r = _gnutls_mpi_alloc_like (b);
+ bigint_t r = _gnutls_mpi_alloc_like (b);
if (r == NULL)
return NULL;
@@ -86,7 +86,7 @@ mpi_t wrap_gcry_mpi_mod( const mpi_t a, const mpi_t b)
return r;
}
-mpi_t wrap_gcry_mpi_powm( mpi_t w, const mpi_t b, const mpi_t e, const mpi_t m)
+bigint_t wrap_gcry_mpi_powm( bigint_t w, const bigint_t b, const bigint_t e, const bigint_t m)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (m);
@@ -99,7 +99,7 @@ mpi_t wrap_gcry_mpi_powm( mpi_t w, const mpi_t b, const mpi_t e, const mpi_t m)
return w;
}
-mpi_t wrap_gcry_mpi_addm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
+bigint_t wrap_gcry_mpi_addm( bigint_t w, const bigint_t a, const bigint_t b, const bigint_t m)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (m);
@@ -112,7 +112,7 @@ mpi_t wrap_gcry_mpi_addm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
return w;
}
-mpi_t wrap_gcry_mpi_subm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
+bigint_t wrap_gcry_mpi_subm( bigint_t w, const bigint_t a, const bigint_t b, const bigint_t m)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (m);
@@ -125,7 +125,7 @@ mpi_t wrap_gcry_mpi_subm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
return w;
}
-mpi_t wrap_gcry_mpi_mulm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
+bigint_t wrap_gcry_mpi_mulm( bigint_t w, const bigint_t a, const bigint_t b, const bigint_t m)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (m);
@@ -138,7 +138,7 @@ mpi_t wrap_gcry_mpi_mulm( mpi_t w, const mpi_t a, const mpi_t b, const mpi_t m)
return w;
}
-mpi_t wrap_gcry_mpi_add( mpi_t w, const mpi_t a, const mpi_t b)
+bigint_t wrap_gcry_mpi_add( bigint_t w, const bigint_t a, const bigint_t b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (b);
@@ -151,7 +151,7 @@ mpi_t wrap_gcry_mpi_add( mpi_t w, const mpi_t a, const mpi_t b)
return w;
}
-mpi_t wrap_gcry_mpi_sub( mpi_t w, const mpi_t a, const mpi_t b)
+bigint_t wrap_gcry_mpi_sub( bigint_t w, const bigint_t a, const bigint_t b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (b);
@@ -164,7 +164,7 @@ mpi_t wrap_gcry_mpi_sub( mpi_t w, const mpi_t a, const mpi_t b)
return w;
}
-mpi_t wrap_gcry_mpi_mul( mpi_t w, const mpi_t a, const mpi_t b)
+bigint_t wrap_gcry_mpi_mul( bigint_t w, const bigint_t a, const bigint_t b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (b);
@@ -178,7 +178,7 @@ mpi_t wrap_gcry_mpi_mul( mpi_t w, const mpi_t a, const mpi_t b)
}
/* q = a / b */
-mpi_t wrap_gcry_mpi_div( mpi_t q, const mpi_t a, const mpi_t b)
+bigint_t wrap_gcry_mpi_div( bigint_t q, const bigint_t a, const bigint_t b)
{
if (q == NULL)
q = _gnutls_mpi_alloc_like (a);
@@ -191,7 +191,7 @@ mpi_t wrap_gcry_mpi_div( mpi_t q, const mpi_t a, const mpi_t b)
return q;
}
-mpi_t wrap_gcry_mpi_add_ui( mpi_t w, const mpi_t a, unsigned long b)
+bigint_t wrap_gcry_mpi_add_ui( bigint_t w, const bigint_t a, unsigned long b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (a);
@@ -204,7 +204,7 @@ mpi_t wrap_gcry_mpi_add_ui( mpi_t w, const mpi_t a, unsigned long b)
return w;
}
-mpi_t wrap_gcry_mpi_sub_ui( mpi_t w, const mpi_t a, unsigned long b)
+bigint_t wrap_gcry_mpi_sub_ui( bigint_t w, const bigint_t a, unsigned long b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (a);
@@ -217,7 +217,7 @@ mpi_t wrap_gcry_mpi_sub_ui( mpi_t w, const mpi_t a, unsigned long b)
return w;
}
-mpi_t wrap_gcry_mpi_mul_ui( mpi_t w, const mpi_t a, unsigned long b)
+bigint_t wrap_gcry_mpi_mul_ui( bigint_t w, const bigint_t a, unsigned long b)
{
if (w == NULL)
w = _gnutls_mpi_alloc_like (a);
@@ -230,17 +230,17 @@ mpi_t wrap_gcry_mpi_mul_ui( mpi_t w, const mpi_t a, unsigned long b)
return w;
}
-int wrap_gcry_prime_check( mpi_t pp)
+int wrap_gcry_prime_check( bigint_t pp)
{
return gcry_prime_check( pp, 0);
}
int wrap_gcry_generate_group( gnutls_group_st *group, unsigned int bits)
{
- mpi_t g = NULL, prime = NULL;
+ bigint_t g = NULL, prime = NULL;
gcry_error_t err;
int result, times = 0, qbits;
- gcry_mpi_t *factors = NULL;
+ gcry_bigint_t *factors = NULL;
/* Calculate the size of a prime factor of (prime-1)/2.
* This is an emulation of the values in "Selecting Cryptographic Key Sizes" paper.
@@ -266,7 +266,7 @@ int wrap_gcry_generate_group( gnutls_group_st *group, unsigned int bits)
gcry_prime_release_factors (factors);
}
- err = gcry_prime_generate ((gcry_mpi_t*)&prime, bits, qbits,
+ err = gcry_prime_generate ((gcry_bigint_t*)&prime, bits, qbits,
&factors, NULL, NULL, GCRY_STRONG_RANDOM,
GCRY_PRIME_FLAG_SPECIAL_FACTOR);
@@ -292,7 +292,7 @@ int wrap_gcry_generate_group( gnutls_group_st *group, unsigned int bits)
/* generate the group generator.
*/
- err = gcry_prime_group_generator ((gcry_mpi_t*)&g, prime, factors, NULL);
+ err = gcry_prime_group_generator ((gcry_bigint_t*)&g, prime, factors, NULL);
if (err != 0)
{
gnutls_assert ();
diff --git a/lib/openpgp/openpgp_int.h b/lib/openpgp/openpgp_int.h
index 6175743718..e4b3f7a9df 100644
--- a/lib/openpgp/openpgp_int.h
+++ b/lib/openpgp/openpgp_int.h
@@ -53,15 +53,15 @@ unsigned int _gnutls_get_pgp_key_usage(unsigned int pgp_usage);
int
_gnutls_openpgp_crt_get_mpis (gnutls_openpgp_crt_t cert, uint32_t keyid[2],
- mpi_t * params, int *params_size);
+ bigint_t * params, int *params_size);
int
_gnutls_openpgp_privkey_get_mpis (gnutls_openpgp_privkey_t pkey, uint32_t keyid[2],
- mpi_t * params, int *params_size);
+ bigint_t * params, int *params_size);
cdk_packet_t _gnutls_openpgp_find_key( cdk_kbnode_t knode, uint32_t keyid[2], unsigned int priv);
-int _gnutls_read_pgp_mpi( cdk_packet_t pkt, unsigned int priv, size_t idx, mpi_t* m);
+int _gnutls_read_pgp_mpi( cdk_packet_t pkt, unsigned int priv, size_t idx, bigint_t* m);
int _gnutls_openpgp_find_subkey_idx( cdk_kbnode_t knode, uint32_t keyid[2],
unsigned int priv);
diff --git a/lib/openpgp/pgp.c b/lib/openpgp/pgp.c
index 4283e96207..de77e28a39 100644
--- a/lib/openpgp/pgp.c
+++ b/lib/openpgp/pgp.c
@@ -992,7 +992,7 @@ gnutls_openpgp_crt_get_subkey_usage (gnutls_openpgp_crt_t key,
return 0;
}
-int _gnutls_read_pgp_mpi( cdk_packet_t pkt, unsigned int priv, size_t idx, mpi_t* m)
+int _gnutls_read_pgp_mpi( cdk_packet_t pkt, unsigned int priv, size_t idx, bigint_t* m)
{
size_t buf_size = 512;
opaque * buf = gnutls_malloc( buf_size);
@@ -1068,7 +1068,7 @@ unsigned int max_pub_params = 0;
*/
int
_gnutls_openpgp_crt_get_mpis (gnutls_openpgp_crt_t cert, uint32_t *keyid /* [2] */,
- mpi_t * params, int *params_size)
+ bigint_t * params, int *params_size)
{
int result, i;
int pk_algorithm, local_params;
@@ -1139,7 +1139,7 @@ int _get_pk_rsa_raw(gnutls_openpgp_crt_t crt, gnutls_openpgp_keyid_t keyid,
int pk_algorithm, ret, i;
cdk_packet_t pkt;
uint32_t kid32[2];
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
if (crt == NULL)
@@ -1205,7 +1205,7 @@ int _get_pk_dsa_raw(gnutls_openpgp_crt_t crt, gnutls_openpgp_keyid_t keyid,
int pk_algorithm, ret, i;
cdk_packet_t pkt;
uint32_t kid32[2];
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
if (crt == NULL)
diff --git a/lib/openpgp/privkey.c b/lib/openpgp/privkey.c
index fc82553fcb..3c25b48851 100644
--- a/lib/openpgp/privkey.c
+++ b/lib/openpgp/privkey.c
@@ -589,7 +589,7 @@ gnutls_openpgp_privkey_get_subkey_id (gnutls_openpgp_privkey_t key,
*/
int
_gnutls_openpgp_privkey_get_mpis (gnutls_openpgp_privkey_t pkey, uint32_t *keyid /*[2]*/,
- mpi_t * params, int *params_size)
+ bigint_t * params, int *params_size)
{
int result, i;
int pk_algorithm, local_params;
@@ -663,7 +663,7 @@ int _get_sk_rsa_raw(gnutls_openpgp_privkey_t pkey, gnutls_openpgp_keyid_t keyid,
int pk_algorithm, ret, i;
cdk_packet_t pkt;
uint32_t kid32[2];
- mpi_t params[MAX_PRIV_PARAMS_SIZE];
+ bigint_t params[MAX_PRIV_PARAMS_SIZE];
int params_size = MAX_PRIV_PARAMS_SIZE;
if (pkey == NULL)
@@ -772,7 +772,7 @@ int _get_sk_dsa_raw(gnutls_openpgp_privkey_t pkey, gnutls_openpgp_keyid_t keyid,
int pk_algorithm, ret, i;
cdk_packet_t pkt;
uint32_t kid32[2];
- mpi_t params[MAX_PRIV_PARAMS_SIZE];
+ bigint_t params[MAX_PRIV_PARAMS_SIZE];
int params_size = MAX_PRIV_PARAMS_SIZE;
if (pkey == NULL)
diff --git a/lib/pk-libgcrypt.c b/lib/pk-libgcrypt.c
index f0b3087bed..891118e0e3 100644
--- a/lib/pk-libgcrypt.c
+++ b/lib/pk-libgcrypt.c
@@ -55,7 +55,7 @@ _wrap_gcry_pk_encrypt(gnutls_pk_algorithm_t algo,
gcry_sexp_t s_ciph = NULL, s_data = NULL, s_pkey = NULL;
int rc = -1;
int ret;
- mpi_t data = NULL;
+ bigint_t data = NULL;
if (_gnutls_mpi_scan_nz(&data, plaintext->data, plaintext->size) != 0) {
gnutls_assert();
@@ -105,7 +105,7 @@ _wrap_gcry_pk_encrypt(gnutls_pk_algorithm_t algo,
goto cleanup;
} else {
gcry_sexp_t list = gcry_sexp_find_token(s_ciph, "a", 0);
- mpi_t res;
+ bigint_t res;
if (list == NULL) {
gnutls_assert();
@@ -155,7 +155,7 @@ _wrap_gcry_pk_decrypt(gnutls_pk_algorithm_t algo,
gcry_sexp_t s_plain = NULL, s_data = NULL, s_pkey = NULL;
int rc = -1;
int ret;
- mpi_t data;
+ bigint_t data;
if (_gnutls_mpi_scan_nz(&data, ciphertext->data, ciphertext->size) != 0) {
gnutls_assert();
@@ -202,7 +202,7 @@ _wrap_gcry_pk_decrypt(gnutls_pk_algorithm_t algo,
gnutls_assert();
return GNUTLS_E_PK_DECRYPTION_FAILED;
} else {
- mpi_t res;
+ bigint_t res;
res = gcry_sexp_nth_mpi(s_plain, 0, 0);
gcry_sexp_release(s_plain);
@@ -248,8 +248,8 @@ _wrap_gcry_pk_sign(gnutls_pk_algorithm_t algo, gnutls_datum_t * signature,
gcry_sexp_t s_hash = NULL, s_key = NULL, s_sig = NULL;
gcry_sexp_t list = NULL;
int rc = -1, ret;
- mpi_t hash;
- mpi_t res[2] = { NULL, NULL };
+ bigint_t hash;
+ bigint_t res[2] = { NULL, NULL };
if (_gnutls_mpi_scan_nz(&hash, vdata->data, vdata->size) != 0) {
gnutls_assert();
@@ -382,8 +382,8 @@ int _wrap_gcry_pk_verify( gnutls_pk_algorithm_t algo,
{
gcry_sexp_t s_sig, s_hash, s_pkey;
int rc = -1, ret;
- mpi_t hash;
- mpi_t tmp[2] = { NULL, NULL };
+ bigint_t hash;
+ bigint_t tmp[2] = { NULL, NULL };
if (_gnutls_mpi_scan_nz(&hash, vdata->data, vdata->size) != 0) {
gnutls_assert();
@@ -489,7 +489,7 @@ cleanup:
return ret;
}
-static int _dsa_generate_params(mpi_t * resarr, int *resarr_len, int bits)
+static int _dsa_generate_params(bigint_t * resarr, int *resarr_len, int bits)
{
int ret;
@@ -588,7 +588,7 @@ static int _dsa_generate_params(mpi_t * resarr, int *resarr_len, int bits)
}
-static int _rsa_generate_params(mpi_t * resarr, int *resarr_len, int bits)
+static int _rsa_generate_params(bigint_t * resarr, int *resarr_len, int bits)
{
int ret;
@@ -697,7 +697,7 @@ int wrap_gcry_pk_generate_params(gnutls_pk_algorithm_t algo,
case GNUTLS_PK_DSA:
params->params_nr = RSA_PRIVATE_PARAMS;
- params->params = gnutls_malloc(sizeof(mpi_t)*params->params_nr);
+ params->params = gnutls_malloc(sizeof(bigint_t)*params->params_nr);
if (params->params == NULL)
{
gnutls_assert();
@@ -707,7 +707,7 @@ int wrap_gcry_pk_generate_params(gnutls_pk_algorithm_t algo,
case GNUTLS_PK_RSA:
params->params_nr = DSA_PRIVATE_PARAMS;
- params->params = gnutls_malloc(sizeof(mpi_t)*params->params_nr);
+ params->params = gnutls_malloc(sizeof(bigint_t)*params->params_nr);
if (params->params == NULL)
{
gnutls_assert();
diff --git a/lib/x509/common.c b/lib/x509/common.c
index d7cf9eb641..b59f6a05f0 100644
--- a/lib/x509/common.c
+++ b/lib/x509/common.c
@@ -1137,7 +1137,7 @@ int
_gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst,
const char *dst_name,
gnutls_pk_algorithm_t
- pk_algorithm, mpi_t * params,
+ pk_algorithm, bigint_t * params,
int params_size)
{
const char *pk;
@@ -1259,7 +1259,7 @@ _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, const char *src_name,
int algo;
char oid[64];
int len;
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
char name[128];
_gnutls_str_cpy (name, sizeof (name), src_name);
diff --git a/lib/x509/common.h b/lib/x509/common.h
index ffc35454f0..ed0d679647 100644
--- a/lib/x509/common.h
+++ b/lib/x509/common.h
@@ -117,7 +117,7 @@ int _gnutls_x509_get_pk_algorithm (ASN1_TYPE src, const char *src_name,
int _gnutls_x509_encode_and_copy_PKI_params (ASN1_TYPE dst,
const char *dst_name,
gnutls_pk_algorithm_t
- pk_algorithm, mpi_t * params,
+ pk_algorithm, bigint_t * params,
int params_size);
int _gnutls_asn1_copy_node (ASN1_TYPE * dst, const char *dst_name,
ASN1_TYPE src, const char *src_name);
diff --git a/lib/x509/mpi.c b/lib/x509/mpi.c
index 247ea543c1..1ff3f65ccf 100644
--- a/lib/x509/mpi.c
+++ b/lib/x509/mpi.c
@@ -37,7 +37,7 @@
* Returns 2 parameters (m,e).
*/
int
-_gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params)
+_gnutls_x509_read_rsa_params (opaque * der, int dersize, bigint_t * params)
{
int result;
ASN1_TYPE spk = ASN1_TYPE_EMPTY;
@@ -88,7 +88,7 @@ _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params)
* params[0-2]
*/
int
-_gnutls_x509_read_dsa_params (opaque * der, int dersize, mpi_t * params)
+_gnutls_x509_read_dsa_params (opaque * der, int dersize, bigint_t * params)
{
int result;
ASN1_TYPE spk = ASN1_TYPE_EMPTY;
@@ -154,7 +154,7 @@ _gnutls_x509_read_dsa_params (opaque * der, int dersize, mpi_t * params)
*/
int
-_gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t * out)
+_gnutls_x509_read_der_int (opaque * der, int dersize, bigint_t * out)
{
int result;
ASN1_TYPE spk = ASN1_TYPE_EMPTY;
@@ -197,7 +197,7 @@ _gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t * out)
* only sets params[3]
*/
int
-_gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, mpi_t * params)
+_gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, bigint_t * params)
{
return _gnutls_x509_read_der_int( der, dersize, &params[3]);
}
@@ -207,7 +207,7 @@ _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, mpi_t * params)
*/
int
_gnutls_x509_crt_get_mpis (gnutls_x509_crt_t cert,
- mpi_t * params, int *params_size)
+ bigint_t * params, int *params_size)
{
int result;
int pk_algorithm;
@@ -237,7 +237,7 @@ _gnutls_x509_crt_get_mpis (gnutls_x509_crt_t cert,
if (*params_size < RSA_PUBLIC_PARAMS)
{
gnutls_assert ();
- /* internal error. Increase the mpi_ts in params */
+ /* internal error. Increase the bigint_ts in params */
result = GNUTLS_E_INTERNAL_ERROR;
goto error;
}
@@ -260,7 +260,7 @@ _gnutls_x509_crt_get_mpis (gnutls_x509_crt_t cert,
if (*params_size < DSA_PUBLIC_PARAMS)
{
gnutls_assert ();
- /* internal error. Increase the mpi_ts in params */
+ /* internal error. Increase the bigint_ts in params */
result = GNUTLS_E_INTERNAL_ERROR;
goto error;
}
@@ -323,7 +323,7 @@ error:
* Allocates the space used to store the DER data.
*/
int
-_gnutls_x509_write_rsa_params (mpi_t * params, int params_size,
+_gnutls_x509_write_rsa_params (bigint_t * params, int params_size,
gnutls_datum_t * der)
{
int result;
@@ -384,7 +384,7 @@ cleanup:
int
_gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name,
gnutls_pk_algorithm_t pk_algorithm,
- gnutls_digest_algorithm_t dig, mpi_t * params,
+ gnutls_digest_algorithm_t dig, bigint_t * params,
int params_size)
{
gnutls_datum_t der;
@@ -457,7 +457,7 @@ _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name,
* Allocates the space used to store the DER data.
*/
int
-_gnutls_x509_write_dsa_params (mpi_t * params, int params_size,
+_gnutls_x509_write_dsa_params (bigint_t * params, int params_size,
gnutls_datum_t * der)
{
int result;
@@ -523,7 +523,7 @@ cleanup:
* Allocates the space used to store the DER data.
*/
int
-_gnutls_x509_write_dsa_public_key (mpi_t * params, int params_size,
+_gnutls_x509_write_dsa_public_key (bigint_t * params, int params_size,
gnutls_datum_t * der)
{
int result;
diff --git a/lib/x509/pkcs12_encr.c b/lib/x509/pkcs12_encr.c
index ce2b045b15..6ed78f64f5 100644
--- a/lib/x509/pkcs12_encr.c
+++ b/lib/x509/pkcs12_encr.c
@@ -61,8 +61,8 @@ _gnutls_pkcs12_string_to_key (unsigned int id, const opaque * salt,
int rc;
unsigned int i, j;
digest_hd_st md;
- mpi_t num_b1 = NULL, num_ij = NULL;
- mpi_t mpi512 = NULL;
+ bigint_t num_b1 = NULL, num_ij = NULL;
+ bigint_t mpi512 = NULL;
unsigned int pwlen;
opaque hash[20], buf_b[64], buf_i[128], *p;
size_t cur_keylen;
diff --git a/lib/x509/privkey.c b/lib/x509/privkey.c
index e1973f2a97..6c52c98ef0 100644
--- a/lib/x509/privkey.c
+++ b/lib/x509/privkey.c
@@ -34,8 +34,8 @@
#include <x509_int.h>
#include <gnutls_pk.h>
-static int _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params);
-int _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params);
+static int _gnutls_asn1_encode_rsa (ASN1_TYPE * c2, bigint_t * params);
+int _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, bigint_t * params);
/* remove this when libgcrypt can handle the PKCS #1 coefficients from
* rsa keys
@@ -155,7 +155,7 @@ _gnutls_privkey_decode_pkcs1_rsa_key (const gnutls_datum_t * raw_key,
{
int result;
ASN1_TYPE pkey_asn;
- mpi_t temp_params[RSA_PRIVATE_PARAMS];
+ bigint_t temp_params[RSA_PRIVATE_PARAMS];
gnutls_pk_params_st pk_params;
pk_params.params = temp_params;
@@ -170,10 +170,10 @@ _gnutls_privkey_decode_pkcs1_rsa_key (const gnutls_datum_t * raw_key,
return NULL;
}
- if ((sizeof (pkey->params) / sizeof (mpi_t)) < RSA_PRIVATE_PARAMS)
+ if ((sizeof (pkey->params) / sizeof (bigint_t)) < RSA_PRIVATE_PARAMS)
{
gnutls_assert ();
- /* internal error. Increase the mpi_ts in params */
+ /* internal error. Increase the bigint_ts in params */
return NULL;
}
@@ -273,10 +273,10 @@ decode_dsa_key (const gnutls_datum_t * raw_key, gnutls_x509_privkey_t pkey)
return NULL;
}
- if ((sizeof (pkey->params) / sizeof (mpi_t)) < DSA_PRIVATE_PARAMS)
+ if ((sizeof (pkey->params) / sizeof (bigint_t)) < DSA_PRIVATE_PARAMS)
{
gnutls_assert ();
- /* internal error. Increase the mpi_ts in params */
+ /* internal error. Increase the bigint_ts in params */
return NULL;
}
@@ -482,7 +482,7 @@ gnutls_x509_privkey_import_rsa_raw (gnutls_x509_privkey_t key,
{
int i = 0, ret;
size_t siz = 0;
- mpi_t temp_params[RSA_PRIVATE_PARAMS];
+ bigint_t temp_params[RSA_PRIVATE_PARAMS];
gnutls_pk_params_st pk_params;
pk_params.params = temp_params;
@@ -960,14 +960,14 @@ gnutls_x509_privkey_export_dsa_raw (gnutls_x509_privkey_t key,
/* Encodes the RSA parameters into an ASN.1 RSA private key structure.
*/
static int
-_gnutls_asn1_encode_rsa (ASN1_TYPE * c2, mpi_t * params)
+_gnutls_asn1_encode_rsa (ASN1_TYPE * c2, bigint_t * params)
{
int result, i;
size_t size[8], total;
opaque *m_data, *pube_data, *prie_data;
opaque *p1_data, *p2_data, *u_data, *exp1_data, *exp2_data;
opaque *all_data = NULL, *p;
- mpi_t exp1 = NULL, exp2 = NULL, q1 = NULL, p1 = NULL;
+ bigint_t exp1 = NULL, exp2 = NULL, q1 = NULL, p1 = NULL;
opaque null = '\0';
gnutls_pk_params_st pk_params;
@@ -1193,7 +1193,7 @@ cleanup:
/* Encodes the DSA parameters into an ASN.1 DSAPrivateKey structure.
*/
int
-_gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params)
+_gnutls_asn1_encode_dsa (ASN1_TYPE * c2, bigint_t * params)
{
int result, i;
size_t size[DSA_PRIVATE_PARAMS], total;
diff --git a/lib/x509/sign.c b/lib/x509/sign.c
index 0337ffdb2b..67078b5468 100644
--- a/lib/x509/sign.c
+++ b/lib/x509/sign.c
@@ -129,7 +129,7 @@ encode_ber_digest_info (gnutls_digest_algorithm_t hash,
*/
static int
pkcs1_rsa_sign (gnutls_digest_algorithm_t hash, const gnutls_datum_t * text,
- mpi_t * params, int params_len, gnutls_datum_t * signature)
+ bigint_t * params, int params_len, gnutls_datum_t * signature)
{
int ret;
opaque _digest[MAX_HASH_SIZE];
@@ -173,7 +173,7 @@ pkcs1_rsa_sign (gnutls_digest_algorithm_t hash, const gnutls_datum_t * text,
static int
dsa_sign (const gnutls_datum_t * text,
- mpi_t * params, int params_len, gnutls_datum_t * signature)
+ bigint_t * params, int params_len, gnutls_datum_t * signature)
{
int ret;
opaque _digest[MAX_HASH_SIZE];
diff --git a/lib/x509/verify.c b/lib/x509/verify.c
index c2217fa2cc..9fbe8eda3e 100644
--- a/lib/x509/verify.c
+++ b/lib/x509/verify.c
@@ -535,7 +535,7 @@ decode_ber_digest_info (const gnutls_datum_t * info,
*/
static int
_pkcs1_rsa_verify_sig (const gnutls_datum_t * text,
- const gnutls_datum_t * signature, mpi_t * params,
+ const gnutls_datum_t * signature, bigint_t * params,
int params_len)
{
gnutls_mac_algorithm_t hash = GNUTLS_MAC_UNKNOWN;
@@ -596,7 +596,7 @@ _pkcs1_rsa_verify_sig (const gnutls_datum_t * text,
*/
static int
dsa_verify_sig (const gnutls_datum_t * text,
- const gnutls_datum_t * signature, mpi_t * params,
+ const gnutls_datum_t * signature, bigint_t * params,
int params_len)
{
int ret;
@@ -628,7 +628,7 @@ dsa_verify_sig (const gnutls_datum_t * text,
static int
verify_sig (const gnutls_datum_t * tbs,
const gnutls_datum_t * signature,
- gnutls_pk_algorithm_t pk, mpi_t * issuer_params,
+ gnutls_pk_algorithm_t pk, bigint_t * issuer_params,
int issuer_params_size)
{
@@ -674,7 +674,7 @@ _gnutls_x509_verify_signature (const gnutls_datum_t * tbs,
const gnutls_datum_t * signature,
gnutls_x509_crt_t issuer)
{
- mpi_t issuer_params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t issuer_params[MAX_PUBLIC_PARAMS_SIZE];
int ret, issuer_params_size, i;
/* Read the MPI parameters from the issuer's certificate.
diff --git a/lib/x509/x509.c b/lib/x509/x509.c
index 2d7ecac828..f911e0d657 100644
--- a/lib/x509/x509.c
+++ b/lib/x509/x509.c
@@ -2029,7 +2029,7 @@ rsadsa_get_key_id (gnutls_x509_crt_t crt, int pk,
unsigned char *output_data,
size_t * output_data_size)
{
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
int i, result = 0;
gnutls_datum_t der = { NULL, 0 };
@@ -2576,7 +2576,7 @@ gnutls_x509_crt_get_pk_rsa_raw (gnutls_x509_crt_t crt,
gnutls_datum_t * m, gnutls_datum_t * e)
{
int ret;
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
int i;
@@ -2645,7 +2645,7 @@ gnutls_x509_crt_get_pk_dsa_raw (gnutls_x509_crt_t crt,
gnutls_datum_t * g, gnutls_datum_t * y)
{
int ret;
- mpi_t params[MAX_PUBLIC_PARAMS_SIZE];
+ bigint_t params[MAX_PUBLIC_PARAMS_SIZE];
int params_size = MAX_PUBLIC_PARAMS_SIZE;
int i;
diff --git a/lib/x509/x509_int.h b/lib/x509/x509_int.h
index 1faf918864..169b223a6c 100644
--- a/lib/x509/x509_int.h
+++ b/lib/x509/x509_int.h
@@ -77,7 +77,7 @@ typedef struct gnutls_x509_privkey_int
/* the size of params depends on the public
* key algorithm
*/
- mpi_t params[MAX_PRIV_PARAMS_SIZE];
+ bigint_t params[MAX_PRIV_PARAMS_SIZE];
/*
* RSA: [0] is modulus
@@ -176,7 +176,7 @@ int _gnutls_x509_privkey_verify_signature (const gnutls_datum_t * tbs,
/* privkey.h */
ASN1_TYPE _gnutls_privkey_decode_pkcs1_rsa_key (const gnutls_datum_t *raw_key,
gnutls_x509_privkey_t pkey);
-int _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, mpi_t * params);
+int _gnutls_asn1_encode_dsa (ASN1_TYPE * c2, bigint_t * params);
/* extensions.c */
int _gnutls_x509_crt_get_extension (gnutls_x509_crt_t cert,
@@ -225,33 +225,33 @@ int _gnutls_x509_ext_gen_proxyCertInfo (int pathLenConstraint,
/* mpi.c */
int _gnutls_x509_crt_get_mpis (gnutls_x509_crt_t cert,
- mpi_t * params, int *params_size);
-int _gnutls_x509_read_rsa_params (opaque * der, int dersize, mpi_t * params);
-int _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, mpi_t * params);
-int _gnutls_x509_read_dsa_params (opaque * der, int dersize, mpi_t * params);
+ bigint_t * params, int *params_size);
+int _gnutls_x509_read_rsa_params (opaque * der, int dersize, bigint_t * params);
+int _gnutls_x509_read_dsa_pubkey (opaque * der, int dersize, bigint_t * params);
+int _gnutls_x509_read_dsa_params (opaque * der, int dersize, bigint_t * params);
-int _gnutls_x509_write_rsa_params (mpi_t * params, int params_size,
+int _gnutls_x509_write_rsa_params (bigint_t * params, int params_size,
gnutls_datum_t * der);
-int _gnutls_x509_write_dsa_params (mpi_t * params, int params_size,
+int _gnutls_x509_write_dsa_params (bigint_t * params, int params_size,
gnutls_datum_t * der);
-int _gnutls_x509_write_dsa_public_key (mpi_t * params, int params_size,
+int _gnutls_x509_write_dsa_public_key (bigint_t * params, int params_size,
gnutls_datum_t * der);
int _gnutls_x509_read_uint (ASN1_TYPE node, const char *value,
unsigned int *ret);
-int _gnutls_x509_read_der_int (opaque * der, int dersize, mpi_t* out);
+int _gnutls_x509_read_der_int (opaque * der, int dersize, bigint_t* out);
int _gnutls_x509_read_int (ASN1_TYPE node, const char *value,
- mpi_t * ret_mpi);
-int _gnutls_x509_write_int (ASN1_TYPE node, const char *value, mpi_t mpi,
+ bigint_t * ret_mpi);
+int _gnutls_x509_write_int (ASN1_TYPE node, const char *value, bigint_t mpi,
int lz);
int _gnutls_x509_write_uint32 (ASN1_TYPE node, const char *value,
uint32_t num);
int _gnutls_x509_write_sig_params (ASN1_TYPE dst, const char *dst_name,
gnutls_pk_algorithm_t pk_algorithm,
- gnutls_digest_algorithm_t, mpi_t * params,
+ gnutls_digest_algorithm_t, bigint_t * params,
int params_size);
/* pkcs12.h */
#include <gnutls/pkcs12.h>