aboutsummaryrefslogtreecommitdiff
path: root/src/input.h
blob: 21b83939ee0676532e646a0d526c2a2032eb5550 (plain) (blame)
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
/*
 * ecgen, tool for generating Elliptic curve domain parameters
 * Copyright (C) 2017 J08nY
 */
#ifndef ECGEN_INPUT_H
#define ECGEN_INPUT_H

#include "random.h"

typedef enum PARAM {
	PARAM_PRIME,
	PARAM_INT,
	PARAM_SHORT,
	PARAM_STRING
} param_t;

/**
 *
 * @param stream
 * @param prompt
 * @param bits
 * @param delim
 * @return
 */
GEN fread_prime(FILE *stream, const char *prompt, long bits, int delim);

/**
 *
 * @param stream
 * @param prompt
 * @param bits
 * @param delim
 * @return
 */
GEN fread_int(FILE *stream, const char *prompt, long bits, int delim);

/**
 *
 * @param stream
 * @param prompt
 * @param delim
 * @return
 */
GEN fread_short(FILE *stream, const char *prompt, int delim);

GEN fread_string(FILE *stream, const char *prompt, int delim);

GEN fread_param(param_t param, FILE *stream, const char *prompt, long bits,
                int delim);

GEN read_param(param_t param, const char *prompt, long bits, int delim);

extern FILE *in;

FILE *input_open(const char *input);

void input_close(FILE *in);

#endif  // ECGEN_INPUT_H