Socket
Book a DemoInstallSign in
Socket

@enclave-e3/wasm

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enclave-e3/wasm

Wasm modules for enclave.

latest
npmnpm
Version
0.1.5
Version published
Maintainers
3
Created
Source

Wasm bundle for enclave

Here we export wasm funcionality for consumption in typescript to enable use to share code between Rust and Typescript.

Usage

This package exposes an init subpackage default function which should be used to universally load the wasm module instead of exporting the default loader.

This is because in modern node there is no need for preloading however in the browser we still need to load the wasm bundle.

❌ DONT USE THE DEFAULT INIT
// Bad! Because this uses the raw loader which doesn't exist in node contexts
import init, { bfvEncryptNumber } from "@enclave-e3/wasm";
✅ DO USE THE EXPORTED SUBMODULE
// Good! Use the universal loader
import init from "@enclave-e3/wasm/init";
import { bfvEncryptNumber } from "@enclave-e3/wasm";

export async function bfvEncryptNumber(
  data: bigint,
  public_key: Uint8Array,
  degree: number,
  plaintext_modulus: bigint,
  moduli: bigint,
): Promise<Uint8Array> {
  await init();
  return bfv_encrypt_number(data, public_key, degree, plaintext_modulus, moduli);
}

FAQs

Package last updated on 13 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts