#include <gnutls_int.h>
#include <gnutls_mpi.h>
#include <gnutls_pk.h>
#include <gnutls_errors.h>
#include <gnutls_datum.h>
#include <gnutls_global.h>
#include <gnutls_num.h>
#include "debug.h"
#include <gc.h>
#include "common.h"
#include "mpi.h"
Go to the source code of this file.
Functions | |
static int | MHD__gnutls_pk_encrypt (int algo, mpi_t *resarr, mpi_t data, mpi_t *pkey, int pkey_len) |
static int | MHD__gnutls_pk_sign (int algo, mpi_t *data, mpi_t hash, mpi_t *pkey, int) |
static int | MHD__gnutls_pk_decrypt (int algo, mpi_t *resarr, mpi_t data, mpi_t *pkey, int) |
int | MHD_gtls_pkcs1_rsa_encrypt (MHD_gnutls_datum_t *ciphertext, const MHD_gnutls_datum_t *plaintext, mpi_t *params, unsigned params_len, unsigned btype) |
int | MHD_gtls_pkcs1_rsa_decrypt (MHD_gnutls_datum_t *plaintext, const MHD_gnutls_datum_t *ciphertext, mpi_t *params, unsigned params_len, unsigned btype) |
int | MHD_gtls_rsa_verify (const MHD_gnutls_datum_t *vdata, const MHD_gnutls_datum_t *ciphertext, mpi_t *params, int params_len, int btype) |
static int MHD__gnutls_pk_decrypt | ( | int | algo, | |
mpi_t * | resarr, | |||
mpi_t | data, | |||
mpi_t * | pkey, | |||
int | pkey_len | |||
) | [static] |
Definition at line 463 of file gnutls_pk.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_PK_DECRYPTION_FAILED, and MHD_gnutls_assert.
Referenced by MHD_gtls_pkcs1_rsa_decrypt().
static int MHD__gnutls_pk_encrypt | ( | int | algo, | |
mpi_t * | resarr, | |||
mpi_t | data, | |||
mpi_t * | pkey, | |||
int | pkey_len | |||
) | [static] |
Definition at line 391 of file gnutls_pk.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_PK_ENCRYPTION_FAILED, and MHD_gnutls_assert.
Referenced by MHD_gtls_pkcs1_rsa_decrypt(), and MHD_gtls_pkcs1_rsa_encrypt().
static int MHD__gnutls_pk_sign | ( | int | algo, | |
mpi_t * | data, | |||
mpi_t | hash, | |||
mpi_t * | pkey, | |||
int | pkey_len | |||
) | [static] |
Definition at line 530 of file gnutls_pk.c.
References GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_PK_SIGN_FAILED, and MHD_gnutls_assert.
Referenced by MHD_gtls_pkcs1_rsa_encrypt().
int MHD_gtls_pkcs1_rsa_decrypt | ( | MHD_gnutls_datum_t * | plaintext, | |
const MHD_gnutls_datum_t * | ciphertext, | |||
mpi_t * | params, | |||
unsigned | params_len, | |||
unsigned | btype | |||
) |
Definition at line 209 of file gnutls_pk.c.
References MHD_gnutls_datum_t::data, GNUTLS_E_DECRYPTION_FAILED, GNUTLS_E_MEMORY_ERROR, GNUTLS_E_MPI_SCAN_FAILED, GNUTLS_E_PK_DECRYPTION_FAILED, MHD__gnutls_handshake_log, MHD__gnutls_mpi_get_nbits, MHD__gnutls_pk_decrypt(), MHD__gnutls_pk_encrypt(), MHD__gnutls_sset_datum, MHD_gnutls_assert, MHD_gtls_mpi_print(), MHD_gtls_mpi_release(), MHD_gtls_mpi_scan_nz(), and MHD_gnutls_datum_t::size.
Referenced by MHD__gnutls_proc_rsa_client_kx(), and MHD_gtls_rsa_verify().
int MHD_gtls_pkcs1_rsa_encrypt | ( | MHD_gnutls_datum_t * | ciphertext, | |
const MHD_gnutls_datum_t * | plaintext, | |||
mpi_t * | params, | |||
unsigned | params_len, | |||
unsigned | btype | |||
) |
Definition at line 55 of file gnutls_pk.c.
References MHD_gnutls_datum_t::data, GC_OK, GNUTLS_E_INTERNAL_ERROR, GNUTLS_E_MEMORY_ERROR, GNUTLS_E_MPI_SCAN_FAILED, GNUTLS_E_PK_ENCRYPTION_FAILED, GNUTLS_E_RANDOM_FAILED, MHD__gnutls_mpi_get_nbits, MHD__gnutls_pk_encrypt(), MHD__gnutls_pk_sign(), MHD_gc_pseudo_random(), MHD_gnutls_assert, MHD_gnutls_malloc, MHD_gtls_mpi_print(), MHD_gtls_mpi_release(), MHD_gtls_mpi_scan_nz(), RSA_PRIVATE_PARAMS, RSA_PUBLIC_PARAMS, and MHD_gnutls_datum_t::size.
Referenced by MHD__gnutls_gen_rsa_client_kx(), and MHD_gtls_sign().
int MHD_gtls_rsa_verify | ( | const MHD_gnutls_datum_t * | vdata, | |
const MHD_gnutls_datum_t * | ciphertext, | |||
mpi_t * | params, | |||
int | params_len, | |||
int | btype | |||
) |
Definition at line 346 of file gnutls_pk.c.
References MHD_gnutls_datum_t::data, GNUTLS_E_PK_SIG_VERIFY_FAILED, MHD__gnutls_free_datum, MHD_gnutls_assert, MHD_gtls_pkcs1_rsa_decrypt(), and MHD_gnutls_datum_t::size.
Referenced by MHD__gnutls_verify_sig().