/src/WasmEdge/include/host/mock/wasi_crypto_func.h
Line | Count | Source (jump to first uncovered line) |
1 | | // SPDX-License-Identifier: Apache-2.0 |
2 | | // SPDX-FileCopyrightText: 2019-2024 Second State INC |
3 | | |
4 | | #pragma once |
5 | | |
6 | | #include "common/errcode.h" |
7 | | #include "host/mock/log.h" |
8 | | #include "runtime/callingframe.h" |
9 | | #include "runtime/hostfunc.h" |
10 | | |
11 | | namespace WasmEdge { |
12 | | namespace Host { |
13 | | namespace WasiCryptoMock { |
14 | | |
15 | | using namespace std::literals; |
16 | | static inline constexpr const uint32_t kWASICryptoError = 1U; |
17 | | |
18 | | namespace Common { |
19 | | class ArrayOutputLen : public Runtime::HostFunction<ArrayOutputLen> { |
20 | | public: |
21 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
22 | 0 | printPluginMock("WASI-Crypto"sv); |
23 | 0 | return kWASICryptoError; |
24 | 0 | } |
25 | | }; |
26 | | |
27 | | class ArrayOutputPull : public Runtime::HostFunction<ArrayOutputPull> { |
28 | | public: |
29 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
30 | 0 | uint32_t, uint32_t) { |
31 | 0 | printPluginMock("WASI-Crypto"sv); |
32 | 0 | return kWASICryptoError; |
33 | 0 | } |
34 | | }; |
35 | | |
36 | | class OptionsOpen : public Runtime::HostFunction<OptionsOpen> { |
37 | | public: |
38 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t) { |
39 | 0 | printPluginMock("WASI-Crypto"sv); |
40 | 0 | return kWASICryptoError; |
41 | 0 | } |
42 | | }; |
43 | | |
44 | | class OptionsClose : public Runtime::HostFunction<OptionsClose> { |
45 | | public: |
46 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
47 | 0 | printPluginMock("WASI-Crypto"sv); |
48 | 0 | return kWASICryptoError; |
49 | 0 | } |
50 | | }; |
51 | | |
52 | | class OptionsSet : public Runtime::HostFunction<OptionsSet> { |
53 | | public: |
54 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
55 | 0 | uint32_t, uint32_t, uint32_t) { |
56 | 0 | printPluginMock("WASI-Crypto"sv); |
57 | 0 | return kWASICryptoError; |
58 | 0 | } |
59 | | }; |
60 | | |
61 | | class OptionsSetU64 : public Runtime::HostFunction<OptionsSetU64> { |
62 | | public: |
63 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
64 | 0 | uint32_t, uint64_t) { |
65 | 0 | printPluginMock("WASI-Crypto"sv); |
66 | 0 | return kWASICryptoError; |
67 | 0 | } |
68 | | }; |
69 | | |
70 | | class OptionsSetGuestBuffer |
71 | | : public Runtime::HostFunction<OptionsSetGuestBuffer> { |
72 | | public: |
73 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
74 | 0 | uint32_t, uint32_t, uint32_t) { |
75 | 0 | printPluginMock("WASI-Crypto"sv); |
76 | 0 | return kWASICryptoError; |
77 | 0 | } |
78 | | }; |
79 | | |
80 | | class SecretsManagerOpen : public Runtime::HostFunction<SecretsManagerOpen> { |
81 | | public: |
82 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t) { |
83 | 0 | printPluginMock("WASI-Crypto"sv); |
84 | 0 | return kWASICryptoError; |
85 | 0 | } |
86 | | }; |
87 | | |
88 | | class SecretsManagerClose : public Runtime::HostFunction<SecretsManagerClose> { |
89 | | public: |
90 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
91 | 0 | printPluginMock("WASI-Crypto"sv); |
92 | 0 | return kWASICryptoError; |
93 | 0 | } |
94 | | }; |
95 | | |
96 | | class SecretsManagerInvalidate |
97 | | : public Runtime::HostFunction<SecretsManagerInvalidate> { |
98 | | public: |
99 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
100 | 0 | uint32_t, uint64_t) { |
101 | 0 | printPluginMock("WASI-Crypto"sv); |
102 | 0 | return kWASICryptoError; |
103 | 0 | } |
104 | | }; |
105 | | } // namespace Common |
106 | | |
107 | | namespace AsymmetricCommon { |
108 | | class KeypairGenerate : public Runtime::HostFunction<KeypairGenerate> { |
109 | | public: |
110 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
111 | 0 | uint32_t, uint32_t, uint32_t) { |
112 | 0 | printPluginMock("WASI-Crypto"sv); |
113 | 0 | return kWASICryptoError; |
114 | 0 | } |
115 | | }; |
116 | | |
117 | | class KeypairImport : public Runtime::HostFunction<KeypairImport> { |
118 | | public: |
119 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
120 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
121 | 0 | printPluginMock("WASI-Crypto"sv); |
122 | 0 | return kWASICryptoError; |
123 | 0 | } |
124 | | }; |
125 | | |
126 | | class KeypairGenerateManaged |
127 | | : public Runtime::HostFunction<KeypairGenerateManaged> { |
128 | | public: |
129 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
130 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
131 | 0 | printPluginMock("WASI-Crypto"sv); |
132 | 0 | return kWASICryptoError; |
133 | 0 | } |
134 | | }; |
135 | | |
136 | | class KeypairStoreManaged : public Runtime::HostFunction<KeypairStoreManaged> { |
137 | | public: |
138 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
139 | 0 | uint32_t, uint32_t) { |
140 | 0 | printPluginMock("WASI-Crypto"sv); |
141 | 0 | return kWASICryptoError; |
142 | 0 | } |
143 | | }; |
144 | | |
145 | | class KeypairReplaceManaged |
146 | | : public Runtime::HostFunction<KeypairReplaceManaged> { |
147 | | public: |
148 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
149 | 0 | int32_t, uint32_t) { |
150 | 0 | printPluginMock("WASI-Crypto"sv); |
151 | 0 | return kWASICryptoError; |
152 | 0 | } |
153 | | }; |
154 | | |
155 | | class KeypairId : public Runtime::HostFunction<KeypairId> { |
156 | | public: |
157 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
158 | 0 | uint32_t, uint32_t, uint32_t) { |
159 | 0 | printPluginMock("WASI-Crypto"sv); |
160 | 0 | return kWASICryptoError; |
161 | 0 | } |
162 | | }; |
163 | | |
164 | | class KeypairFromId : public Runtime::HostFunction<KeypairFromId> { |
165 | | public: |
166 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
167 | 0 | uint32_t, uint64_t, uint32_t) { |
168 | 0 | printPluginMock("WASI-Crypto"sv); |
169 | 0 | return kWASICryptoError; |
170 | 0 | } |
171 | | }; |
172 | | |
173 | | class KeypairFromPkAndSk : public Runtime::HostFunction<KeypairFromPkAndSk> { |
174 | | public: |
175 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
176 | 0 | uint32_t) { |
177 | 0 | printPluginMock("WASI-Crypto"sv); |
178 | 0 | return kWASICryptoError; |
179 | 0 | } |
180 | | }; |
181 | | |
182 | | class KeypairExport : public Runtime::HostFunction<KeypairExport> { |
183 | | public: |
184 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
185 | 0 | uint32_t) { |
186 | 0 | printPluginMock("WASI-Crypto"sv); |
187 | 0 | return kWASICryptoError; |
188 | 0 | } |
189 | | }; |
190 | | |
191 | | class KeypairPublickey : public Runtime::HostFunction<KeypairPublickey> { |
192 | | public: |
193 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
194 | 0 | printPluginMock("WASI-Crypto"sv); |
195 | 0 | return kWASICryptoError; |
196 | 0 | } |
197 | | }; |
198 | | |
199 | | class KeypairSecretkey : public Runtime::HostFunction<KeypairSecretkey> { |
200 | | public: |
201 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
202 | 0 | printPluginMock("WASI-Crypto"sv); |
203 | 0 | return kWASICryptoError; |
204 | 0 | } |
205 | | }; |
206 | | |
207 | | class KeypairClose : public Runtime::HostFunction<KeypairClose> { |
208 | | public: |
209 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
210 | 0 | printPluginMock("WASI-Crypto"sv); |
211 | 0 | return kWASICryptoError; |
212 | 0 | } |
213 | | }; |
214 | | |
215 | | class PublickeyImport : public Runtime::HostFunction<PublickeyImport> { |
216 | | public: |
217 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
218 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
219 | 0 | printPluginMock("WASI-Crypto"sv); |
220 | 0 | return kWASICryptoError; |
221 | 0 | } |
222 | | }; |
223 | | |
224 | | class PublickeyExport : public Runtime::HostFunction<PublickeyExport> { |
225 | | public: |
226 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
227 | 0 | uint32_t) { |
228 | 0 | printPluginMock("WASI-Crypto"sv); |
229 | 0 | return kWASICryptoError; |
230 | 0 | } |
231 | | }; |
232 | | |
233 | | class PublickeyVerify : public Runtime::HostFunction<PublickeyVerify> { |
234 | | public: |
235 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
236 | 0 | printPluginMock("WASI-Crypto"sv); |
237 | 0 | return kWASICryptoError; |
238 | 0 | } |
239 | | }; |
240 | | |
241 | | class PublickeyFromSecretkey |
242 | | : public Runtime::HostFunction<PublickeyFromSecretkey> { |
243 | | public: |
244 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
245 | 0 | printPluginMock("WASI-Crypto"sv); |
246 | 0 | return kWASICryptoError; |
247 | 0 | } |
248 | | }; |
249 | | |
250 | | class PublickeyClose : public Runtime::HostFunction<PublickeyClose> { |
251 | | public: |
252 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
253 | 0 | printPluginMock("WASI-Crypto"sv); |
254 | 0 | return kWASICryptoError; |
255 | 0 | } |
256 | | }; |
257 | | |
258 | | class SecretkeyImport : public Runtime::HostFunction<SecretkeyImport> { |
259 | | public: |
260 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
261 | 0 | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) { |
262 | 0 | printPluginMock("WASI-Crypto"sv); |
263 | 0 | return kWASICryptoError; |
264 | 0 | } |
265 | | }; |
266 | | |
267 | | class SecretkeyExport : public Runtime::HostFunction<SecretkeyExport> { |
268 | | public: |
269 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
270 | 0 | uint32_t) { |
271 | 0 | printPluginMock("WASI-Crypto"sv); |
272 | 0 | return kWASICryptoError; |
273 | 0 | } |
274 | | }; |
275 | | |
276 | | class SecretkeyClose : public Runtime::HostFunction<SecretkeyClose> { |
277 | | public: |
278 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
279 | 0 | printPluginMock("WASI-Crypto"sv); |
280 | 0 | return kWASICryptoError; |
281 | 0 | } |
282 | | }; |
283 | | } // namespace AsymmetricCommon |
284 | | |
285 | | namespace Kx { |
286 | | class Dh : public Runtime::HostFunction<Dh> { |
287 | | public: |
288 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
289 | 0 | uint32_t) { |
290 | 0 | printPluginMock("WASI-Crypto"sv); |
291 | 0 | return kWASICryptoError; |
292 | 0 | } |
293 | | }; |
294 | | |
295 | | class Encapsulate : public Runtime::HostFunction<Encapsulate> { |
296 | | public: |
297 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
298 | 0 | uint32_t) { |
299 | 0 | printPluginMock("WASI-Crypto"sv); |
300 | 0 | return kWASICryptoError; |
301 | 0 | } |
302 | | }; |
303 | | |
304 | | class Decapsulate : public Runtime::HostFunction<Decapsulate> { |
305 | | public: |
306 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
307 | 0 | uint32_t, uint32_t) { |
308 | 0 | printPluginMock("WASI-Crypto"sv); |
309 | 0 | return kWASICryptoError; |
310 | 0 | } |
311 | | }; |
312 | | } // namespace Kx |
313 | | |
314 | | namespace Signatures { |
315 | | class Export : public Runtime::HostFunction<Export> { |
316 | | public: |
317 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
318 | 0 | uint32_t) { |
319 | 0 | printPluginMock("WASI-Crypto"sv); |
320 | 0 | return kWASICryptoError; |
321 | 0 | } |
322 | | }; |
323 | | |
324 | | class Import : public Runtime::HostFunction<Import> { |
325 | | public: |
326 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
327 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
328 | 0 | printPluginMock("WASI-Crypto"sv); |
329 | 0 | return kWASICryptoError; |
330 | 0 | } |
331 | | }; |
332 | | |
333 | | class StateOpen : public Runtime::HostFunction<StateOpen> { |
334 | | public: |
335 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
336 | 0 | printPluginMock("WASI-Crypto"sv); |
337 | 0 | return kWASICryptoError; |
338 | 0 | } |
339 | | }; |
340 | | |
341 | | class StateUpdate : public Runtime::HostFunction<StateUpdate> { |
342 | | public: |
343 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
344 | 0 | uint32_t) { |
345 | 0 | printPluginMock("WASI-Crypto"sv); |
346 | 0 | return kWASICryptoError; |
347 | 0 | } |
348 | | }; |
349 | | |
350 | | class StateSign : public Runtime::HostFunction<StateSign> { |
351 | | public: |
352 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
353 | 0 | printPluginMock("WASI-Crypto"sv); |
354 | 0 | return kWASICryptoError; |
355 | 0 | } |
356 | | }; |
357 | | |
358 | | class StateClose : public Runtime::HostFunction<StateClose> { |
359 | | public: |
360 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
361 | 0 | printPluginMock("WASI-Crypto"sv); |
362 | 0 | return kWASICryptoError; |
363 | 0 | } |
364 | | }; |
365 | | |
366 | | class VerificationStateOpen |
367 | | : public Runtime::HostFunction<VerificationStateOpen> { |
368 | | public: |
369 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
370 | 0 | printPluginMock("WASI-Crypto"sv); |
371 | 0 | return kWASICryptoError; |
372 | 0 | } |
373 | | }; |
374 | | |
375 | | class VerificationStateUpdate |
376 | | : public Runtime::HostFunction<VerificationStateUpdate> { |
377 | | public: |
378 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
379 | 0 | uint32_t) { |
380 | 0 | printPluginMock("WASI-Crypto"sv); |
381 | 0 | return kWASICryptoError; |
382 | 0 | } |
383 | | }; |
384 | | |
385 | | class VerificationStateVerify |
386 | | : public Runtime::HostFunction<VerificationStateVerify> { |
387 | | public: |
388 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t) { |
389 | 0 | printPluginMock("WASI-Crypto"sv); |
390 | 0 | return kWASICryptoError; |
391 | 0 | } |
392 | | }; |
393 | | |
394 | | class VerificationStateClose |
395 | | : public Runtime::HostFunction<VerificationStateClose> { |
396 | | public: |
397 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
398 | 0 | printPluginMock("WASI-Crypto"sv); |
399 | 0 | return kWASICryptoError; |
400 | 0 | } |
401 | | }; |
402 | | |
403 | | class Close : public Runtime::HostFunction<Close> { |
404 | | public: |
405 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
406 | 0 | printPluginMock("WASI-Crypto"sv); |
407 | 0 | return kWASICryptoError; |
408 | 0 | } |
409 | | }; |
410 | | |
411 | | } // namespace Signatures |
412 | | |
413 | | namespace Symmetric { |
414 | | class KeyGenerate : public Runtime::HostFunction<KeyGenerate> { |
415 | | public: |
416 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
417 | 0 | uint32_t, uint32_t) { |
418 | 0 | printPluginMock("WASI-Crypto"sv); |
419 | 0 | return kWASICryptoError; |
420 | 0 | } |
421 | | }; |
422 | | |
423 | | class KeyImport : public Runtime::HostFunction<KeyImport> { |
424 | | public: |
425 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
426 | 0 | uint32_t, uint32_t, uint32_t) { |
427 | 0 | printPluginMock("WASI-Crypto"sv); |
428 | 0 | return kWASICryptoError; |
429 | 0 | } |
430 | | }; |
431 | | |
432 | | class KeyExport : public Runtime::HostFunction<KeyExport> { |
433 | | public: |
434 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
435 | 0 | printPluginMock("WASI-Crypto"sv); |
436 | 0 | return kWASICryptoError; |
437 | 0 | } |
438 | | }; |
439 | | |
440 | | class KeyClose : public Runtime::HostFunction<KeyClose> { |
441 | | public: |
442 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
443 | 0 | printPluginMock("WASI-Crypto"sv); |
444 | 0 | return kWASICryptoError; |
445 | 0 | } |
446 | | }; |
447 | | |
448 | | class KeyGenerateManaged : public Runtime::HostFunction<KeyGenerateManaged> { |
449 | | public: |
450 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
451 | 0 | uint32_t, uint32_t, uint32_t) { |
452 | 0 | printPluginMock("WASI-Crypto"sv); |
453 | 0 | return kWASICryptoError; |
454 | 0 | } |
455 | | }; |
456 | | |
457 | | class KeyStoreManaged : public Runtime::HostFunction<KeyStoreManaged> { |
458 | | public: |
459 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
460 | 0 | uint32_t, uint32_t) { |
461 | 0 | printPluginMock("WASI-Crypto"sv); |
462 | 0 | return kWASICryptoError; |
463 | 0 | } |
464 | | }; |
465 | | |
466 | | class KeyReplaceManaged : public Runtime::HostFunction<KeyReplaceManaged> { |
467 | | public: |
468 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, int32_t, |
469 | 0 | int32_t, uint32_t) { |
470 | 0 | printPluginMock("WASI-Crypto"sv); |
471 | 0 | return kWASICryptoError; |
472 | 0 | } |
473 | | }; |
474 | | |
475 | | class KeyId : public Runtime::HostFunction<KeyId> { |
476 | | public: |
477 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
478 | 0 | uint32_t, uint32_t, uint32_t) { |
479 | 0 | printPluginMock("WASI-Crypto"sv); |
480 | 0 | return kWASICryptoError; |
481 | 0 | } |
482 | | }; |
483 | | |
484 | | class KeyFromId : public Runtime::HostFunction<KeyFromId> { |
485 | | public: |
486 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
487 | 0 | uint32_t, uint64_t, uint32_t) { |
488 | 0 | printPluginMock("WASI-Crypto"sv); |
489 | 0 | return kWASICryptoError; |
490 | 0 | } |
491 | | }; |
492 | | |
493 | | class StateOpen : public Runtime::HostFunction<StateOpen> { |
494 | | public: |
495 | | Expect<uint32_t> body(const Runtime::CallingFrame &, uint32_t, uint32_t, |
496 | 0 | uint32_t, uint32_t, uint32_t) { |
497 | 0 | printPluginMock("WASI-Crypto"sv); |
498 | 0 | return kWASICryptoError; |
499 | 0 | } |
500 | | }; |
501 | | |
502 | | class StateClone : public Runtime::HostFunction<StateClone> { |
503 | | public: |
504 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
505 | 0 | printPluginMock("WASI-Crypto"sv); |
506 | 0 | return kWASICryptoError; |
507 | 0 | } |
508 | | }; |
509 | | |
510 | | class StateOptionsGet : public Runtime::HostFunction<StateOptionsGet> { |
511 | | public: |
512 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
513 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
514 | 0 | printPluginMock("WASI-Crypto"sv); |
515 | 0 | return kWASICryptoError; |
516 | 0 | } |
517 | | }; |
518 | | |
519 | | class StateOptionsGetU64 : public Runtime::HostFunction<StateOptionsGetU64> { |
520 | | public: |
521 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
522 | 0 | uint32_t, uint32_t) { |
523 | 0 | printPluginMock("WASI-Crypto"sv); |
524 | 0 | return kWASICryptoError; |
525 | 0 | } |
526 | | }; |
527 | | |
528 | | class StateClose : public Runtime::HostFunction<StateClose> { |
529 | | public: |
530 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
531 | 0 | printPluginMock("WASI-Crypto"sv); |
532 | 0 | return kWASICryptoError; |
533 | 0 | } |
534 | | }; |
535 | | |
536 | | class StateAbsorb : public Runtime::HostFunction<StateAbsorb> { |
537 | | public: |
538 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
539 | 0 | uint32_t) { |
540 | 0 | printPluginMock("WASI-Crypto"sv); |
541 | 0 | return kWASICryptoError; |
542 | 0 | } |
543 | | }; |
544 | | |
545 | | class StateSqueeze : public Runtime::HostFunction<StateSqueeze> { |
546 | | public: |
547 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
548 | 0 | uint32_t) { |
549 | 0 | printPluginMock("WASI-Crypto"sv); |
550 | 0 | return kWASICryptoError; |
551 | 0 | } |
552 | | }; |
553 | | |
554 | | class StateSqueezeTag : public Runtime::HostFunction<StateSqueezeTag> { |
555 | | public: |
556 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
557 | 0 | printPluginMock("WASI-Crypto"sv); |
558 | 0 | return kWASICryptoError; |
559 | 0 | } |
560 | | }; |
561 | | |
562 | | class StateSqueezeKey : public Runtime::HostFunction<StateSqueezeKey> { |
563 | | public: |
564 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
565 | 0 | uint32_t, uint32_t) { |
566 | 0 | printPluginMock("WASI-Crypto"sv); |
567 | 0 | return kWASICryptoError; |
568 | 0 | } |
569 | | }; |
570 | | |
571 | | class StateMaxTagLen : public Runtime::HostFunction<StateMaxTagLen> { |
572 | | public: |
573 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
574 | 0 | printPluginMock("WASI-Crypto"sv); |
575 | 0 | return kWASICryptoError; |
576 | 0 | } |
577 | | }; |
578 | | |
579 | | class StateEncrypt : public Runtime::HostFunction<StateEncrypt> { |
580 | | public: |
581 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
582 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
583 | 0 | printPluginMock("WASI-Crypto"sv); |
584 | 0 | return kWASICryptoError; |
585 | 0 | } |
586 | | }; |
587 | | |
588 | | class StateEncryptDetached |
589 | | : public Runtime::HostFunction<StateEncryptDetached> { |
590 | | public: |
591 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
592 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
593 | 0 | printPluginMock("WASI-Crypto"sv); |
594 | 0 | return kWASICryptoError; |
595 | 0 | } |
596 | | }; |
597 | | |
598 | | class StateDecrypt : public Runtime::HostFunction<StateDecrypt> { |
599 | | public: |
600 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
601 | 0 | uint32_t, uint32_t, uint32_t, uint32_t) { |
602 | 0 | printPluginMock("WASI-Crypto"sv); |
603 | 0 | return kWASICryptoError; |
604 | 0 | } |
605 | | }; |
606 | | |
607 | | class StateDecryptDetached |
608 | | : public Runtime::HostFunction<StateDecryptDetached> { |
609 | | public: |
610 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
611 | | uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, |
612 | 0 | uint32_t) { |
613 | 0 | printPluginMock("WASI-Crypto"sv); |
614 | 0 | return kWASICryptoError; |
615 | 0 | } |
616 | | }; |
617 | | |
618 | | class StateRatchet : public Runtime::HostFunction<StateRatchet> { |
619 | | public: |
620 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
621 | 0 | printPluginMock("WASI-Crypto"sv); |
622 | 0 | return kWASICryptoError; |
623 | 0 | } |
624 | | }; |
625 | | |
626 | | class TagLen : public Runtime::HostFunction<TagLen> { |
627 | | public: |
628 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t) { |
629 | 0 | printPluginMock("WASI-Crypto"sv); |
630 | 0 | return kWASICryptoError; |
631 | 0 | } |
632 | | }; |
633 | | |
634 | | class TagPull : public Runtime::HostFunction<TagPull> { |
635 | | public: |
636 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
637 | 0 | uint32_t, uint32_t) { |
638 | 0 | printPluginMock("WASI-Crypto"sv); |
639 | 0 | return kWASICryptoError; |
640 | 0 | } |
641 | | }; |
642 | | |
643 | | class TagVerify : public Runtime::HostFunction<TagVerify> { |
644 | | public: |
645 | | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t, uint32_t, |
646 | 0 | uint32_t) { |
647 | 0 | printPluginMock("WASI-Crypto"sv); |
648 | 0 | return kWASICryptoError; |
649 | 0 | } |
650 | | }; |
651 | | |
652 | | class TagClose : public Runtime::HostFunction<TagClose> { |
653 | | public: |
654 | 0 | Expect<uint32_t> body(const Runtime::CallingFrame &, int32_t) { |
655 | 0 | printPluginMock("WASI-Crypto"sv); |
656 | 0 | return kWASICryptoError; |
657 | 0 | } |
658 | | }; |
659 | | } // namespace Symmetric |
660 | | |
661 | | } // namespace WasiCryptoMock |
662 | | } // namespace Host |
663 | | } // namespace WasmEdge |