Function instantiateSecp256k1Bytes

  • This method is like instantiateSecp256k1, but requires the consumer to Window.fetch or fs.readFile the secp256k1.wasm binary and provide it to this method as webassemblyBytes. This skips a base64 decoding of an embedded binary.

    Randomizing the Context with randomSeed

    This method also accepts an optional, 32-byte randomSeed, which is passed to the contextRandomize method in the underlying WebAssembly.

    In the secp256k1 C library, context randomization is an additional layer of security from side-channel attacks that attempt to extract private key information by analyzing things like a CPU's emitted radio frequencies or power usage.

    As most applications also benefit from deterministic, reproducible behavior, context is not randomized by default in Libauth. To randomize the context, provide a 32-byte Uint8Array of cryptographically strong random values (e.g. crypto.getRandomValues(new Uint8Array(32))).

    Parameters

    • webassemblyBytes: ArrayBuffer

      an ArrayBuffer containing the bytes from Libauth's secp256k1.wasm binary. Providing this buffer manually may be faster than the internal base64 decode that happens in instantiateSecp256k1.

    • Optional randomSeed: Uint8Array

      a 32-byte random seed used to randomize the secp256k1 context after creation. See above for details.

    Returns Promise<Secp256k1>

Generated using TypeDoc