blob: 9b25100aeb194ce43c139395972153337ae3e747 (
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
40
41
42
43
|
/*
* ecgen, tool for generating Elliptic curve domain parameters
* Copyright (C) 2017-2018 J08nY
*/
#ifndef ECGEN_CM_PRIME_H
#define ECGEN_CM_PRIME_H
#include "misc/config.h"
#include "misc/types.h"
typedef struct {
/* Stuff filled with qdisc_next. */
GEN p;
GEN t;
GEN D;
/* Stuff for saving state. */
GEN order;
GEN r;
GEN i;
GEN* Sp;
size_t nprimes;
} cm_prime_qdisc_t;
/**
* Algorithm mostly from:
* Constructing elliptic curves of prime order
* by Reinier Broker and Peter Stevenhagen
* @param order the requested order, must be prime
* @return
*/
curve_t* cm_prime_curve(GEN order);
/**
* @brief
* @param curve
* @param args
* @param state
* @return
*/
GENERATOR(cm_gen_curve_prime);
#endif // ECGEN_CM_PRIME_H
|