aboutsummaryrefslogtreecommitdiff
path: root/src/gen/order.h
blob: 14f5a450f949f5b4167a134a0fd71726faf63148 (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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
/**
 * @file order.h
 */
#ifndef ECGEN_ORDER_H
#define ECGEN_ORDER_H

#include "misc/types.h"

/**
 * GENERATOR(gen_f)
 * Reads the curve order from input, does not verify it.
 *
 * @param curve A curve_t being generated
 * @param cfg An application config
 * @param args Current optional generator argument
 * @return state diff
 * @return state diff
 */
GENERATOR(order_gen_input);

/**
 * GENERATOR(gen_f)
 * Calculates the curve order, using a general algorithm.
 * Always succeeds.
 *
 * @param curve A curve_t being generated
 * @param cfg An application config
 * @param args Current optional generator argument
 * @return state diff
 */
GENERATOR(order_gen_any);

/**
 * GENERATOR(gen_f)
 * Calculates the curve order, using the SEA algorithm.
 *
 * @param curve A curve_t being generated
 * @param cfg An application config
 * @param args unused
 * @return state diff
 */
GENERATOR(order_gen_sea);

/**
 * GENERATOR(gen_f)
 *
 * @param curve A curve_t being generated
 * @param cfg An application config
 * @param args pari_ulong passed to ellsea(curve, smallfact)
 * @return state diff
 */
GENERATOR(order_gen_smallfact);

/**
 * GENERATOR(gen_f)
 * Calculates the curve order, always using the SEA algorithm,
 * gives up early in case the order is divisible by "something".
 * Succeeds if the curve has a prime order.
 *
 * @param curve A curve_t being generated
 * @param cfg An application config
 * @param args unused
 * @return state diff
 */
GENERATOR(order_gen_prime);

#endif  // ECGEN_ORDER_H