Commit 94a2fe58 authored by Niels Möller's avatar Niels Möller
Browse files

Constified.

Rev: src/bignum.c:1.11
Rev: src/bignum.h:1.13
parent 380aab21
......@@ -31,7 +31,7 @@
#include "prime_table.h"
static void limbs_to_octets(mpz_t n, UINT32 length,
static void limbs_to_octets(const mpz_t n, UINT32 length,
UINT8 pad, UINT8 *data)
{
UINT8 *dst = data + length - 1;
......@@ -85,7 +85,7 @@ void bignum_parse_s(mpz_t n, UINT32 length, UINT8 *data)
mpz_clear(digit);
}
static int mpz_size_of_complement(mpz_t n)
static int mpz_size_of_complement(const mpz_t n)
{
int bits;
......@@ -103,7 +103,7 @@ static int mpz_size_of_complement(mpz_t n)
}
/* This function should handle both positive and negative numbers */
UINT32 bignum_format_s_length(mpz_t n)
UINT32 bignum_format_s_length(const mpz_t n)
{
switch(mpz_sgn(n))
{
......@@ -118,7 +118,7 @@ UINT32 bignum_format_s_length(mpz_t n)
}
}
UINT32 bignum_format_s(mpz_t n, UINT8 *data)
UINT32 bignum_format_s(const mpz_t n, UINT8 *data)
{
switch(mpz_sgn(n))
{
......@@ -173,7 +173,7 @@ void bignum_parse_u(mpz_t n, UINT32 length, UINT8 *data)
mpz_clear(digit);
}
UINT32 bignum_format_u_length(mpz_t n)
UINT32 bignum_format_u_length(const mpz_t n)
{
switch(mpz_sgn(n))
{
......@@ -191,7 +191,7 @@ void bignum_write(mpz_t n, unsigned length, UINT8 *data)
limbs_to_octets(n, length, 0, data);
}
UINT32 bignum_format_u(mpz_t n, UINT8 *data)
UINT32 bignum_format_u(const mpz_t n, UINT8 *data)
{
switch(mpz_sgn(n))
{
......
......@@ -45,11 +45,11 @@
void bignum_parse_s(mpz_t n, UINT32 length, UINT8 *data);
void bignum_parse_u(mpz_t n, UINT32 length, UINT8 *data);
UINT32 bignum_format_s(mpz_t n, UINT8 *data);
UINT32 bignum_format_s_length(mpz_t n);
UINT32 bignum_format_s(const mpz_t n, UINT8 *data);
UINT32 bignum_format_s_length(const mpz_t n);
UINT32 bignum_format_u(mpz_t n, UINT8 *data);
UINT32 bignum_format_u_length(mpz_t n);
UINT32 bignum_format_u(const mpz_t n, UINT8 *data);
UINT32 bignum_format_u_length(const mpz_t n);
void bignum_write(mpz_t n, unsigned length, UINT8 *data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment