MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / body

Method body

plugins/wasi_crypto/kx/func.cpp:11–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace Kx {
10
11Expect<uint32_t> Dh::body(const Runtime::CallingFrame &Frame, int32_t PkHandle,
12 int32_t SkHandle,
13 uint32_t /* Out */ SharedSecretPtr) {
14 auto *MemInst = Frame.getMemoryByIndex(0);
15 checkExist(MemInst);
16
17 auto *const SharedSecret =
18 MemInst->getPointer<__wasi_array_output_t *>(SharedSecretPtr);
19 checkExist(SharedSecret);
20
21 if (auto Res = Ctx.kxDh(PkHandle, SkHandle); unlikely(!Res)) {
22 return Res.error();
23 } else {
24 *SharedSecret = *Res;
25 }
26
27 return __WASI_CRYPTO_ERRNO_SUCCESS;
28}
29
30Expect<uint32_t> Encapsulate::body(const Runtime::CallingFrame &Frame,
31 int32_t PkHandle,

Callers

nothing calls this directly

Calls 5

unlikelyFunction · 0.85
getMemoryByIndexMethod · 0.80
kxDhMethod · 0.45
kxEncapsulateMethod · 0.45
kxDecapsulateMethod · 0.45

Tested by

no test coverage detected