PHP WebShell

Текущая директория: /opt/BitGoJS/modules/sdk-core/dist/src/bitgo

Просмотр файла: ecdh.d.ts

/**
 * @prettier
 *
 * Utility methods for Ellipic-Curve Diffie-Hellman (ECDH) shared secret generation
 *
 * > Elliptic-curve Diffie–Hellman (ECDH) is a key agreement protocol that allows two parties, each having an
 * > elliptic-curve public–private key pair, to establish a shared secret over an insecure channel.
 * > This shared secret may be directly used as a key, or to derive another key. The key, or the derived key, can then
 * > be used to encrypt subsequent communications using a symmetric-key cipher. It is a variant of the Diffie–Hellman
 * > protocol using elliptic-curve cryptography.
 *
 * https://en.wikipedia.org/wiki/Elliptic-curve_Diffie%E2%80%93Hellman
 */
import { ECPairInterface, BIP32Interface } from '@bitgo/utxo-lib';
/**
 * Calculate the Elliptic Curve Diffie Hellman
 * @param privateKey HDNode of private key
 * @param publicKey [neutered] HDNode of public key
 * @returns Buffer public key buffer that can be used as shared secret (see note)
 */
export declare function getSharedSecret(privateKey: BIP32Interface | ECPairInterface | Buffer, publicKey: BIP32Interface | Buffer): Buffer;
/**
 Signs a message using a given ecdh xprv at a given path
 */
export declare function signMessageWithDerivedEcdhKey(message: string, xprv: string, path: string): Buffer;
/**
 Verifies if a message was signed using the given ecdh key
 @param message message to verify
 @param signature hex encoded signature used to sign the message
 @param ecdhXpub pubkey/derived pubkey of ecdh keychain used to sign
 */
export declare function verifyEcdhSignature(message: string, signature: string, ecdhXpub: Buffer): boolean;
//# sourceMappingURL=ecdh.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!