aboutsummaryrefslogtreecommitdiff
path: root/src/math/order.h
blob: 4562fab971888ffc07b444f611ce3ca2f06b8067 (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
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
/**
 * @file order.h
 */
#ifndef ECGEN_ORDER_H
#define ECGEN_ORDER_H

#include "types.h"

/**
 * GENERATOR(gen_t)
 * Calculates the curve order, using a general algorithm.
 * Always succeeds.
 *
 * @param curve
 * @param cfg
 * @param args
 * @return state diff
 */
int order_init(curve_t *curve, config_t *cfg, arg_t *args);

/**
 * GENERATOR(gen_t)
 *
 * @param curve
 * @param cfg
 * @param args
 * @return
 */
int order_smallfact(curve_t *curve, config_t *cfg, arg_t *args);

/**
 * GENERATOR(gen_t)
 * 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
 * @param cfg
 * @param args
 * @return state diff
 */
int order_prime(curve_t *curve, config_t *cfg, arg_t *args);

#endif  // ECGEN_ORDER_H