| 9 | namespace Kx { |
| 10 | |
| 11 | Expect<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 | |
| 30 | Expect<uint32_t> Encapsulate::body(const Runtime::CallingFrame &Frame, |
| 31 | int32_t PkHandle, |
nothing calls this directly
no test coverage detected