forked from contrun/libecc
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlib_ecc_types.h
129 lines (124 loc) · 2.43 KB
/
lib_ecc_types.h
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* Copyright (C) 2017 - This file is part of libecc project
*
* Authors:
* Ryad BENADJILA <ryadbenadjila@gmail.com>
* Arnaud EBALARD <arnaud.ebalard@ssi.gouv.fr>
* Jean-Pierre FLORI <jean-pierre.flori@ssi.gouv.fr>
*
* Contributors:
* Nicolas VIVET <nicolas.vivet@ssi.gouv.fr>
* Karim KHALFALLAH <karim.khalfallah@ssi.gouv.fr>
*
* This software is licensed under a dual BSD and GPL v2 license.
* See LICENSE file at the root folder of the project.
*/
#ifndef __LIB_ECC_TYPES_H__
#define __LIB_ECC_TYPES_H__
#include "lib_ecc_config.h"
/* Signature algorithm types */
typedef enum {
UNKNOWN_SIG_ALG = 0,
#ifdef WITH_SIG_ECDSA
ECDSA = 1,
#endif
#ifdef WITH_SIG_ECKCDSA
ECKCDSA = 2,
#endif
#ifdef WITH_SIG_ECSDSA
ECSDSA = 3,
#endif
#ifdef WITH_SIG_ECOSDSA
ECOSDSA = 4,
#endif
#ifdef WITH_SIG_ECFSDSA
ECFSDSA = 5,
#endif
#ifdef WITH_SIG_ECGDSA
ECGDSA = 6,
#endif
#ifdef WITH_SIG_ECRDSA
ECRDSA = 7,
#endif
} ec_sig_alg_type;
/* Hash algorithm types */
typedef enum {
UNKNOWN_HASH_ALG = 0,
#ifdef WITH_HASH_SHA224
SHA224 = 1,
#endif
#ifdef WITH_HASH_SHA256
SHA256 = 2,
#endif
#ifdef WITH_HASH_SHA384
SHA384 = 3,
#endif
#ifdef WITH_HASH_SHA512
SHA512 = 4,
#endif
#ifdef WITH_HASH_SHA512_224
SHA512_224 = 5,
#endif
#ifdef WITH_HASH_SHA512_256
SHA512_256 = 6,
#endif
#ifdef WITH_HASH_SHA3_224
SHA3_224 = 7,
#endif
#ifdef WITH_HASH_SHA3_256
SHA3_256 = 8,
#endif
#ifdef WITH_HASH_SHA3_384
SHA3_384 = 9,
#endif
#ifdef WITH_HASH_SHA3_512
SHA3_512 = 10,
#endif
COPY256 = 11,
} hash_alg_type;
/* All curves we support */
typedef enum {
UNKNOWN_CURVE = 0,
#ifdef WITH_CURVE_FRP256V1
FRP256V1 = 1,
#endif
#ifdef WITH_CURVE_SECP192R1
SECP192R1 = 2,
#endif
#ifdef WITH_CURVE_SECP224R1
SECP224R1 = 3,
#endif
#ifdef WITH_CURVE_SECP256R1
SECP256R1 = 4,
#endif
#ifdef WITH_CURVE_SECP384R1
SECP384R1 = 5,
#endif
#ifdef WITH_CURVE_SECP521R1
SECP521R1 = 6,
#endif
#ifdef WITH_CURVE_BRAINPOOLP224R1
BRAINPOOLP224R1 = 7,
#endif
#ifdef WITH_CURVE_BRAINPOOLP256R1
BRAINPOOLP256R1 = 8,
#endif
#ifdef WITH_CURVE_BRAINPOOLP512R1
BRAINPOOLP512R1 = 9,
#endif
#ifdef WITH_CURVE_GOST256
GOST256 = 10,
#endif
#ifdef WITH_CURVE_GOST512
GOST512 = 11,
#endif
#ifdef WITH_CURVE_BRAINPOOLP384R1
BRAINPOOLP384R1 = 12,
#endif
/* ADD curves type here */
/* XXX: Do not remove the comment above, as it is
* used by external tools as a placeholder to add or
* remove automatically generated code.
*/
} ec_curve_type;
#endif /* __LIB_ECC_TYPES_H__ */