19 #ifndef GMP_PK_CRYPTO_H_
20 #define GMP_PK_CRYPTO_H_
30 #define fe2mpz(fieldele) (((gmp_fe*) (fieldele))->get_val())
31 #define num2mpz(number) (((gmp_num*) (number))->get_val())
43 num* get_rnd_num(uint32_t bitlen = 0);
45 fe* get_rnd_fe(uint32_t bitlen);
47 fe* get_rnd_generator();
53 uint32_t num_byte_size() {
54 return ceil_divide(secparam.ifcbits, 8);
56 uint32_t get_field_size() {
57 return secparam.ifcbits;
62 void init(
seclvl sp, uint8_t* seed);
67 gmp_randstate_t rnd_state;
78 void set_mul(
fe* a,
fe* b);
79 void set_pow(
fe* b,
num* e);
80 void set_div(
fe* a,
fe* b);
81 void set_double_pow_mul(
fe* b1,
num* e1,
fe* b2,
num* e2);
82 void export_to_bytes(uint8_t* buf);
83 void import_from_bytes(uint8_t* buf);
84 void sample_fe_from_bytes(uint8_t* buf, uint32_t bytelen);
106 void set_si(int32_t src);
107 void set_add(
num* a,
num* b);
108 void set_mul(
num* a,
num* b);
112 void export_to_bytes(uint8_t* buf, uint32_t field_size);
113 void import_from_bytes(uint8_t* buf, uint32_t field_size);
114 void set_rnd(uint32_t bits);
132 void pow(
fe* result,
num* e);
136 uint32_t m_numberOfElements;
142 void mpz_export_padded(uint8_t* pBufIdx, uint32_t field_size, mpz_t to_export);
Definition: pk-crypto.h:77
Definition: pk-crypto.h:99
Definition: pk-crypto.h:59
Definition: pk-crypto.h:30
Virtual class for public-key operations.
Definition: gmp-pk-crypto.h:70
Definition: gmp-pk-crypto.h:33
Definition: gmp-pk-crypto.h:100
Definition: gmp-pk-crypto.h:124
Definition: typedefs.h:79