UNPKG

686 BJavaScriptView Raw
1// Copyright 2017-2022 @polkadot/util-crypto authors & contributors
2// SPDX-License-Identifier: Apache-2.0
3import '@polkadot/x-bigint/shim';
4import { utils as utilsNobleSecp256k1 } from '@noble/secp256k1';
5import { u8aConcat } from '@polkadot/util';
6import { cryptoWaitReady } from "./crypto.js";
7import { hmacSha256AsU8a } from "./hmac/index.js"; // Set overrides on the secp256k1 utils
8// - hmacShaSync - This needs to be set, unset by default
9
10utilsNobleSecp256k1.hmacSha256Sync = (key, ...messages) => hmacSha256AsU8a(key, u8aConcat(...messages)); // start init process immediately
11
12
13cryptoWaitReady().catch(() => {// shouldn't happen, logged and caught inside cryptoWaitReady
14});
\No newline at end of file