CRS
Isogeny-based post-quantum Diffie-Hellman protocol.
Classes | Typedefs | Functions
binary_trees.h File Reference
#include <gmp.h>
#include <flint/fmpz.h>
#include <flint/fq.h>
#include <flint/fq_poly.h>

Go to the source code of this file.

Classes

struct  fq_poly_bcell_t
 
struct  fq_poly_btree_t
 

Typedefs

typedef struct fq_poly_bcell_t fq_poly_bcell_t
 
typedef struct fq_poly_btree_t fq_poly_btree_t
 

Functions

void fq_poly_bcell_init (fq_poly_bcell_t *, const fq_ctx_t *)
 
void fq_poly_bcell_set (fq_poly_bcell_t *, fq_poly_t)
 
void fq_poly_bcell_set_ (fq_poly_bcell_t *, fq_poly_bcell_t *, fq_poly_bcell_t *, fq_poly_t)
 
int fq_poly_bcell_set_right (fq_poly_bcell_t *, fq_poly_bcell_t *)
 
int fq_poly_bcell_set_left (fq_poly_bcell_t *, fq_poly_bcell_t *)
 
void fq_poly_bcell_clear (fq_poly_bcell_t *)
 
void fq_poly_btree_init (fq_poly_btree_t *, const fq_ctx_t *)
 
void fq_poly_btree_set (fq_poly_btree_t *, fq_poly_bcell_t *)
 
void fq_poly_btree_clear (fq_poly_btree_t *)
 

Typedef Documentation

◆ fq_poly_bcell_t

Representation of binary links with fq_poly as nodes.

◆ fq_poly_btree_t

Representation of binary tree with fq_poly_bcell_t nodes.

Function Documentation

◆ fq_poly_bcell_clear()

void fq_poly_bcell_clear ( fq_poly_bcell_t b)

Recursively clears the given bcell, releasing any memory used. It must be reinitialised in order to be used again.

◆ fq_poly_bcell_init()

void fq_poly_bcell_init ( fq_poly_bcell_t b,
const fq_ctx_t *  F 
)

Initializes b for use, with context F, and setting its childs to NULL. A corresponding call to fq_poly_bcell_clear() must be made after finishing with the fq_poly_bcell_t to free the memory used by the cell.

◆ fq_poly_bcell_set()

void fq_poly_bcell_set ( fq_poly_bcell_t b,
fq_poly_t  p 
)

Sets b to bcell with data p.

◆ fq_poly_bcell_set_()

void fq_poly_bcell_set_ ( fq_poly_bcell_t b,
fq_poly_bcell_t left,
fq_poly_bcell_t right,
fq_poly_t  p 
)

Sets b to bcell with data p and childs left/right.

◆ fq_poly_bcell_set_left()

int fq_poly_bcell_set_left ( fq_poly_bcell_t b1,
fq_poly_bcell_t b2 
)

Sets left child of b1 to b2. Returns -1 if b1 already has a left child.

◆ fq_poly_bcell_set_right()

int fq_poly_bcell_set_right ( fq_poly_bcell_t b1,
fq_poly_bcell_t b2 
)

Sets right child of b1 to b2. Returns -1 if b1 already has a right child.

◆ fq_poly_btree_clear()

void fq_poly_btree_clear ( fq_poly_btree_t t)

Recursively clears the given tree and its bcells, releasing any memory used. It must be reinitialised in order to be used again.

◆ fq_poly_btree_init()

void fq_poly_btree_init ( fq_poly_btree_t t,
const fq_ctx_t *  F 
)

Initializes t for use, with context F. A corresponding call to fq_poly_btree_clear() must be made after finishing with the fq_poly_btree_t to free the memory used by the tree.

◆ fq_poly_btree_set()

void fq_poly_btree_set ( fq_poly_btree_t t,
fq_poly_bcell_t b 
)

Sets t to tree with head bcell b. TODO: check ctx