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

#include "math/random.h"

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

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

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

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

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

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

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

extern FILE *in;

void input_init(const char *input);

void input_quit(void);

#endif  // ECGEN_INPUT_H