|
Packit Service |
4684c1 |
/*
|
|
Packit Service |
4684c1 |
* Copyright (C) 2000-2012 Free Software Foundation, Inc.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* Author: Nikos Mavrogiannopoulos
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This file is part of GnuTLS.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* The GnuTLS is free software; you can redistribute it and/or
|
|
Packit Service |
4684c1 |
* modify it under the terms of the GNU Lesser General Public License
|
|
Packit Service |
4684c1 |
* as published by the Free Software Foundation; either version 2.1 of
|
|
Packit Service |
4684c1 |
* the License, or (at your option) any later version.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* This library is distributed in the hope that it will be useful, but
|
|
Packit Service |
4684c1 |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
4684c1 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit Service |
4684c1 |
* Lesser General Public License for more details.
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
* You should have received a copy of the GNU Lesser General Public License
|
|
Packit Service |
4684c1 |
* along with this program. If not, see <https://www.gnu.org/licenses/>
|
|
Packit Service |
4684c1 |
*
|
|
Packit Service |
4684c1 |
*/
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#ifndef GNUTLS_LIB_MPI_H
|
|
Packit Service |
4684c1 |
#define GNUTLS_LIB_MPI_H
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include "gnutls_int.h"
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#include <crypto-backend.h>
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
extern int crypto_bigint_prio;
|
|
Packit Service |
4684c1 |
extern gnutls_crypto_bigint_st _gnutls_mpi_ops;
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
bigint_t _gnutls_mpi_random_modp(bigint_t, bigint_t p,
|
|
Packit Service |
4684c1 |
gnutls_rnd_level_t level);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_init _gnutls_mpi_ops.bigint_init
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_init_multi _gnutls_mpi_ops.bigint_init_multi
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_clear _gnutls_mpi_ops.bigint_clear
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_cmp _gnutls_mpi_ops.bigint_cmp
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_cmp_ui _gnutls_mpi_ops.bigint_cmp_ui
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_mod _gnutls_mpi_ops.bigint_mod
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_modm _gnutls_mpi_ops.bigint_modm
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_set _gnutls_mpi_ops.bigint_set
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_set_ui _gnutls_mpi_ops.bigint_set_ui
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_get_nbits _gnutls_mpi_ops.bigint_get_nbits
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_powm _gnutls_mpi_ops.bigint_powm
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_addm _gnutls_mpi_ops.bigint_addm
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_subm _gnutls_mpi_ops.bigint_subm
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_mulm _gnutls_mpi_ops.bigint_mulm
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_add _gnutls_mpi_ops.bigint_add
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_sub _gnutls_mpi_ops.bigint_sub
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_mul _gnutls_mpi_ops.bigint_mul
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_div _gnutls_mpi_ops.bigint_div
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_add_ui _gnutls_mpi_ops.bigint_add_ui
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_sub_ui _gnutls_mpi_ops.bigint_sub_ui
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_mul_ui _gnutls_mpi_ops.bigint_mul_ui
|
|
Packit Service |
4684c1 |
#define _gnutls_prime_check _gnutls_mpi_ops.bigint_prime_check
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_print(x,y,z) _gnutls_mpi_ops.bigint_print(x,y,z,GNUTLS_MPI_FORMAT_USG)
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_print_lz(x,y,z) _gnutls_mpi_ops.bigint_print(x,y,z,GNUTLS_MPI_FORMAT_STD)
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_print_le(x,y,z) _gnutls_mpi_ops.bigint_print(x,y,z,GNUTLS_MPI_FORMAT_ULE)
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_copy _gnutls_mpi_ops.bigint_copy
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_scan(r, b, s) _gnutls_mpi_ops.bigint_scan(r, b, s, GNUTLS_MPI_FORMAT_USG)
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_scan_le(r, b, s) _gnutls_mpi_ops.bigint_scan(r, b, s, GNUTLS_MPI_FORMAT_ULE)
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
inline static
|
|
Packit Service |
4684c1 |
void _gnutls_mpi_release(bigint_t * x)
|
|
Packit Service |
4684c1 |
{
|
|
Packit Service |
4684c1 |
if (*x == NULL)
|
|
Packit Service |
4684c1 |
return;
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
_gnutls_mpi_ops.bigint_release(*x);
|
|
Packit Service |
4684c1 |
*x = NULL;
|
|
Packit Service |
4684c1 |
}
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_init_scan(bigint_t * ret_mpi, const void *buffer,
|
|
Packit Service |
4684c1 |
size_t nbytes);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_init_scan_nz(bigint_t * ret_mpi, const void *buffer,
|
|
Packit Service |
4684c1 |
size_t nbytes);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_init_scan_le(bigint_t * ret_mpi, const void *buffer,
|
|
Packit Service |
4684c1 |
size_t nbytes);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_dprint_le(const bigint_t a, gnutls_datum_t * dest);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_dprint_lz(const bigint_t a, gnutls_datum_t * dest);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_dprint(const bigint_t a, gnutls_datum_t * dest);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_dprint_size(const bigint_t a, gnutls_datum_t * dest,
|
|
Packit Service |
4684c1 |
size_t size);
|
|
Packit Service |
4684c1 |
int _gnutls_mpi_bprint_size(const bigint_t a, uint8_t *buf, size_t size);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
typedef int (*mpi_dprint_func)(const bigint_t a, gnutls_datum_t * dest);
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#define _gnutls_mpi_generate_group( gg, bits) _gnutls_mpi_ops.bigint_generate_group( gg, bits)
|
|
Packit Service |
4684c1 |
|
|
Packit Service |
4684c1 |
#endif /* GNUTLS_LIB_MPI_H */
|