libtc  20160415
Threshold Cryptography functions library
mathutils.h
Go to the documentation of this file.
1 #ifndef MATHUTILS_H
2 #define MATHUTILS_H
3 
4 #include <gmp.h>
5 
6 typedef void (*random_fn)(mpz_t rop, int bit_len);
7 
8 void random_dev(mpz_t rop, int bit_len);
9 void random_prime(mpz_t rop, int bit_len, random_fn random);
10 
11 typedef struct poly {
12  mpz_t * coeff;
13  int size;
14 } poly_t;
15 
16 poly_t * create_random_poly(mpz_t d, size_t size, mpz_t m);
17 void clear_poly(poly_t * poly);
18 void poly_eval(mpz_t rop, poly_t * poly, mpz_t op);
19 void poly_eval_ui(mpz_t rop, poly_t * poly, unsigned long op);
20 #endif
void random_prime(mpz_t rop, int bit_len, random_fn random)
Definition: random.c:26
void poly_eval_ui(mpz_t rop, poly_t *poly, unsigned long op)
Definition: poly.c:70
void poly_eval(mpz_t rop, poly_t *poly, mpz_t op)
Definition: poly.c:49
poly_t * create_random_poly(mpz_t d, size_t size, mpz_t m)
Definition: poly.c:9
void random_dev(mpz_t rop, int bit_len)
Definition: random.c:8
int size
Definition: mathutils.h:13
void clear_poly(poly_t *poly)
Definition: poly.c:35
mpz_t * coeff
Definition: mathutils.h:12
void(* random_fn)(mpz_t rop, int bit_len)
Definition: mathutils.h:6
struct poly poly_t
Definition: mathutils.h:11