aboutsummaryrefslogtreecommitdiff
path: root/src/exhaustive/exhaustive.h
blob: ddc1ef6bdefaa35f2707a0cb8f51f6341c787e2b (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
/**
 * @file exhaustive.h
 */
#ifndef ECGEN_GENERATORS_H
#define ECGEN_GENERATORS_H

#include "misc/types.h"

/**
 * @brief
 */
typedef struct {
	gen_f *generators;
	check_t **validators;
	arg_t **argss;
	unroll_f *unrolls;
} exhaustive_t;

/**
 * @brief
 * @return
 */
exhaustive_t *exhaustive_new(void);

/**
 * @brief
 * @param generators
 * @param validators
 * @param argss
 * @param unrolls
 * @return
 */
exhaustive_t *exhaustive_create(gen_f *generators, check_t **validators,
                                arg_t **argss, unroll_f *unrolls);

/**
 * @brief
 * @param setup
 */
void exhaustive_clear(exhaustive_t *setup);

/**
 * @brief
 * @param setup
 */
void exhaustive_free(exhaustive_t **setup);

/**
 *
 * @param unrolls
 * @param cfg
 */
void exhaustive_uinit(unroll_f *unrolls, const config_t *cfg);

/**
 *
 * @param curve
 * @param cfg
 * @param setup
 * @param start_offset
 * @param end_offset
 * @param retry
 * @return
 */
int exhaustive_gen_retry(curve_t *curve, const config_t *cfg,
                         const exhaustive_t *setup, offset_e start_offset,
                         offset_e end_offset, int retry);

/**
 *
 * @param curve
 * @param config
 * @param setup
 * @param start_offset
 * @param end_offset
 * @return
 */
int exhaustive_gen(curve_t *curve, const config_t *cfg,
                   const exhaustive_t *setup, offset_e start_offset,
                   offset_e end_offset);

/**
 *
 * @param cfg
 * @return
 */
int exhaustive_do(config_t *cfg);

#endif  // ECGEN_GENERATORS_H