* feat: able to encrypt & decrypt message in keyring - ed25519 & sr25519 types * chore: make eslint happy * test: add in one more test on cross-usage of ed25519 & sr25519 * make lint happy without eslint-disable * assert away secp256k1 for encrypt/decrypt * Update packages/keyring/src/pair/index.ts * Update packages/keyring/src/pair/index.ts Co-authored-by: Jaco <jacogr@gmail.com>
13 lines
421 B
TypeScript
13 lines
421 B
TypeScript
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import ed2curve from 'ed2curve';
|
|
|
|
export function convertSecretKeyToCurve25519 (secretKey: Uint8Array): Uint8Array {
|
|
return ed2curve.convertSecretKey(secretKey);
|
|
}
|
|
|
|
export function convertPublicKeyToCurve25519 (publicKey: Uint8Array): Uint8Array {
|
|
return ed2curve.convertPublicKey(publicKey) as Uint8Array;
|
|
}
|