summaryrefslogtreecommitdiff
path: root/src/field.h
blob: 55d6bf92382427fffe164faf49bd51e896a7b6ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
#ifndef ECGEN_FIELD_H
#define ECGEN_FIELD_H

#include "poly.h"
#include "gp.h"

/**
 *
 * @param bits
 * @return
 */
GEN field_primer(long bits);

/**
 *
 * @param bits
 * @return
 */
GEN field_binaryr(long bits);

/**
 * Extract a field representation from a field.
 *  - char(field) == 2:
 *    returns the vector of powers of middle coefficients of the reduction polynomial.
 *  - char(field) != 2:
 *     returns the field characteristic(p).-
 *
 * @param field
 * @return field representation
 */
GEN field_params(GEN field);

GEN field_elementi(GEN element);

#endif //ECGEN_FIELD_H