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: Uint8Arraya 32-byte random seed used to randomize the secp256k1 context after creation. See above for details.
Generated using TypeDoc
This method is like instantiateSecp256k1, but requires the consumer to
Window.fetch
orfs.readFile
thesecp256k1.wasm
binary and provide it to this method aswebassemblyBytes
. 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 thecontextRandomize
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))
).