Cleanup elliptic imports (#729)

This commit is contained in:
Jaco Greeff
2020-10-26 21:37:51 +01:00
committed by GitHub
parent e1ef295bfa
commit 253776a510
6 changed files with 6 additions and 12 deletions
@@ -1,10 +1,9 @@
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
import { assert } from '@polkadot/util';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
export default function secp256k1Compress (publicKey: Uint8Array): Uint8Array {
+1 -2
View File
@@ -1,10 +1,9 @@
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
import { assert, bnToU8a, u8aConcat } from '@polkadot/util';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
export default function secp256k1Expand (publicKey: Uint8Array): Uint8Array {
@@ -3,10 +3,9 @@
import { Keypair } from '../../types';
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
import { assert, bnToU8a } from '@polkadot/util';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
/**
@@ -1,9 +1,8 @@
// Copyright 2017-2020 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
/**
+1 -2
View File
@@ -4,12 +4,11 @@
import { Keypair } from '../types';
import { HashType } from './types';
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
import { assert, bnToU8a, u8aConcat } from '@polkadot/util';
import hasher from './hasher';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
/**
+1 -2
View File
@@ -3,13 +3,12 @@
import { HashType } from './types';
import elliptic from 'elliptic';
import { ec as EC } from 'elliptic';
import { assert, u8aEq, u8aToU8a } from '@polkadot/util';
import secp256k1Expand from './expand';
import hasher from './hasher';
const EC = elliptic.ec;
const ec = new EC('secp256k1');
/**