Files
common/packages/util-crypto/src/ed25519/convertKey.ts
T
Jaco be8cabbd1e Rename {ed, sr}25519 functions (#1237)
* Rename {ed, sr}25519 functions

* Finalize renames

* Fix wasm imports

* CHANGELOG
2021-11-24 15:21:28 +02:00

15 lines
511 B
TypeScript

// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
// SPDX-License-Identifier: Apache-2.0
import ed2curve from 'ed2curve';
import { assertReturn } from '@polkadot/util';
export function convertSecretKeyToCurve25519 (secretKey: Uint8Array): Uint8Array {
return ed2curve.convertSecretKey(secretKey);
}
export function convertPublicKeyToCurve25519 (publicKey: Uint8Array): Uint8Array {
return assertReturn(ed2curve.convertPublicKey(publicKey), 'Unable to convert publicKey to ed25519');
}