12#ifndef BOTAN_POLYN_GF2M_H_
13#define BOTAN_POLYN_GF2M_H_
15#include <botan/secmem.h>
28class RandomNumberGenerator;
36 explicit polyn_gf2m(std::shared_ptr<GF2m_Field> sp_field);
47 polyn_gf2m(
int d, std::shared_ptr<GF2m_Field> sp_field);
57 polyn_gf2m(
const uint8_t* mem, uint32_t mem_len, std::shared_ptr<GF2m_Field> sp_field);
62 polyn_gf2m(
int degree,
const uint8_t* mem,
size_t mem_byte_len, std::shared_ptr<GF2m_Field> sp_field);
109 void encode(uint32_t min_numo_coeffs, uint8_t* mem, uint32_t mem_len)
const;
139 void set_degree(
int d) {
m_deg = d; }
142 void realloc(uint32_t new_size);
secure_vector< uint8_t > encode() const
std::shared_ptr< GF2m_Field > get_sp_field() const
bool operator!=(const polyn_gf2m &other) const
static std::pair< polyn_gf2m, polyn_gf2m > eea_with_coefficients(const polyn_gf2m &p, const polyn_gf2m &g, int break_deg)
void set_coef(size_t i, gf2m v)
polyn_gf2m(polyn_gf2m &&other)
gf2m get_coef(size_t i) const
std::string to_string() const
gf2m get_lead_coef() const
polyn_gf2m & operator=(const polyn_gf2m &)=default
static std::vector< polyn_gf2m > sqmod_init(const polyn_gf2m &g)
void swap(polyn_gf2m &other)
static std::vector< polyn_gf2m > sqrt_mod_init(const polyn_gf2m &g)
polyn_gf2m & operator=(polyn_gf2m &&other)
void encode(uint32_t min_numo_coeffs, uint8_t *mem, uint32_t mem_len) const
gf2m operator[](size_t i) const
void add_to_coef(size_t i, gf2m v)
secure_vector< gf2m > coeff
int calc_degree_secure() const
void patchup_deg_secure(uint32_t trgt_deg, volatile gf2m patch_elem)
bool operator==(const polyn_gf2m &other) const
gf2m & operator[](size_t i)
polyn_gf2m sqmod(const std::vector< polyn_gf2m > &sq, int d)
size_t degppf(const polyn_gf2m &g)
std::shared_ptr< GF2m_Field > m_sp_field
std::vector< polyn_gf2m > syndrome_init(polyn_gf2m const &generator, std::vector< gf2m > const &support, int n)
gf2m random_code_element(uint16_t code_length, RandomNumberGenerator &rng)
gf2m random_gf2m(RandomNumberGenerator &rng)
secure_vector< gf2m > find_roots_gf2m_decomp(const polyn_gf2m &polyn, size_t code_length)
std::vector< T, secure_allocator< T > > secure_vector