forked from wolfSSL/wolfssl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsakke.h
143 lines (133 loc) · 3.57 KB
/
sakke.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
130
131
132
133
134
135
136
137
138
139
140
141
142
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_InitSakkeKey(SakkeKey* key, void* heap, int devId);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_InitSakkeKey_ex(SakkeKey* key, int keySize, int curveId,
void* heap, int devId);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API void wc_FreeSakkeKey(SakkeKey* key);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_MakeSakkeKey(SakkeKey* key, WC_RNG* rng);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_MakeSakkePublicKey(SakkeKey* key, ecc_point* pub);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_MakeSakkeRsk(SakkeKey* key, const byte* id, word16 idSz,
ecc_point* rsk);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_ValidateSakkeRsk(SakkeKey* key, const byte* id, word16 idSz,
ecc_point* rsk, int* valid);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_GenerateSakkeRskTable(const SakkeKey* key,
const ecc_point* rsk, byte* table, word32* len);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ExportSakkeKey(SakkeKey* key, byte* data, word32* sz);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ImportSakkeKey(SakkeKey* key, const byte* data, word32 sz);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ExportSakkePrivateKey(SakkeKey* key, byte* data, word32* sz);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ImportSakkePrivateKey(SakkeKey* key, const byte* data,
word32 sz);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_EncodeSakkeRsk(const SakkeKey* key, ecc_point* rsk,
byte* out, word32* sz, int raw);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_DecodeSakkeRsk(const SakkeKey* key, const byte* data,
word32 sz, ecc_point* rsk);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_ImportSakkeRsk(SakkeKey* key, const byte* data, word32 sz);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ExportSakkePublicKey(SakkeKey* key, byte* data,
word32* sz, int raw);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_ImportSakkePublicKey(SakkeKey* key, const byte* data,
word32 sz, int trusted);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_GetSakkeAuthSize(SakkeKey* key, word16* authSz);
/*!
\ingroup SAKKE_Setup
*/
WOLFSSL_API int wc_SetSakkeIdentity(SakkeKey* key, const byte* id, word16 idSz);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_MakeSakkePointI(SakkeKey* key, const byte* id, word16 idSz);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_GetSakkePointI(SakkeKey* key, byte* data, word32* sz);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_SetSakkePointI(SakkeKey* key, const byte* id, word16 idSz,
const byte* data, word32 sz);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_GenerateSakkePointITable(SakkeKey* key, byte* table,
word32* len);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_SetSakkePointITable(SakkeKey* key, byte* table, word32 len);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_ClearSakkePointITable(SakkeKey* key);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_MakeSakkeEncapsulatedSSV(SakkeKey* key,
enum wc_HashType hashType, byte* ssv, word16 ssvSz, byte* auth,
word16* authSz);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_GenerateSakkeSSV(SakkeKey* key, WC_RNG* rng, byte* ssv,
word16* ssvSz);
/*!
\ingroup SAKKE_RSK
*/
WOLFSSL_API int wc_SetSakkeRsk(SakkeKey* key, const ecc_point* rsk, byte* table,
word32 len);
/*!
\ingroup SAKKE_Operations
*/
WOLFSSL_API int wc_DeriveSakkeSSV(SakkeKey* key, enum wc_HashType hashType,
byte* ssv, word16 ssvSz, const byte* auth,
word16 authSz);