Remove types from VCS
This commit is contained in:
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
import { EnglishMnemonic } from "./englishmnemonic";
|
||||
export declare class Bip39 {
|
||||
/**
|
||||
* Encodes raw entropy of length 16, 20, 24, 28 or 32 bytes as an English mnemonic between 12 and 24 words.
|
||||
*
|
||||
* | Entropy | Words |
|
||||
* |--------------------|-------|
|
||||
* | 128 bit (16 bytes) | 12 |
|
||||
* | 160 bit (20 bytes) | 15 |
|
||||
* | 192 bit (24 bytes) | 18 |
|
||||
* | 224 bit (28 bytes) | 21 |
|
||||
* | 256 bit (32 bytes) | 24 |
|
||||
*
|
||||
*
|
||||
* @see https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic
|
||||
* @param entropy The entropy to be encoded. This must be cryptographically secure.
|
||||
*/
|
||||
static encode(entropy: Uint8Array): EnglishMnemonic;
|
||||
static decode(mnemonic: EnglishMnemonic): Uint8Array;
|
||||
static mnemonicToSeed(mnemonic: EnglishMnemonic, password?: string): Promise<Uint8Array>;
|
||||
private static pbkdf2;
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
export declare class EnglishMnemonic {
|
||||
static readonly wordlist: readonly string[];
|
||||
private static readonly mnemonicMatcher;
|
||||
private readonly data;
|
||||
constructor(mnemonic: string);
|
||||
toString(): string;
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export interface HashFunction {
|
||||
readonly blockSize: number;
|
||||
readonly update: (_: Uint8Array) => HashFunction;
|
||||
readonly digest: () => Uint8Array;
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Hmac<H extends HashFunction> implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly messageHasher;
|
||||
private readonly oKeyPad;
|
||||
private readonly iKeyPad;
|
||||
private readonly hash;
|
||||
constructor(hashFunctionConstructor: new () => H, originalKey: Uint8Array);
|
||||
update(data: Uint8Array): Hmac<H>;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
Vendored
-29
@@ -1,29 +0,0 @@
|
||||
export { Bip39 } from "./bip39";
|
||||
export { EnglishMnemonic } from "./englishmnemonic";
|
||||
export { HashFunction } from "./hash";
|
||||
export { Hmac } from "./hmac";
|
||||
export { Keccak256, keccak256 } from "./keccak";
|
||||
export {
|
||||
Xchacha20poly1305Ietf,
|
||||
xchacha20NonceLength,
|
||||
Argon2id,
|
||||
Argon2idOptions,
|
||||
isArgon2idOptions,
|
||||
Ed25519,
|
||||
Ed25519Keypair,
|
||||
} from "./libsodium";
|
||||
export { Random } from "./random";
|
||||
export { Ripemd160, ripemd160 } from "./ripemd";
|
||||
export { Secp256k1, Secp256k1Keypair } from "./secp256k1";
|
||||
export { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
export { Sha1, sha1, Sha256, sha256, Sha512, sha512 } from "./sha";
|
||||
export {
|
||||
HdPath,
|
||||
pathToString,
|
||||
stringToPath,
|
||||
Slip10,
|
||||
Slip10Curve,
|
||||
Slip10RawIndex,
|
||||
Slip10Result,
|
||||
slip10CurveFromString,
|
||||
} from "./slip10";
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Keccak256 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Keccak256;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Keccak256(data).digest()` */
|
||||
export declare function keccak256(data: Uint8Array): Uint8Array;
|
||||
Vendored
-52
@@ -1,52 +0,0 @@
|
||||
export interface Argon2idOptions {
|
||||
/** Output length in bytes */
|
||||
readonly outputLength: number;
|
||||
/**
|
||||
* An integer between 1 and 4294967295 representing the computational difficulty.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
|
||||
*/
|
||||
readonly opsLimit: number;
|
||||
/**
|
||||
* Memory limit measured in KiB (like argon2 command line tool)
|
||||
*
|
||||
* Note: only approximately 16 MiB of memory are available using the non-sumo version of libsodium.js
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/password_hashing/default_phf#key-derivation
|
||||
*/
|
||||
readonly memLimitKib: number;
|
||||
}
|
||||
export declare function isArgon2idOptions(thing: unknown): thing is Argon2idOptions;
|
||||
export declare class Argon2id {
|
||||
static execute(password: string, salt: Uint8Array, options: Argon2idOptions): Promise<Uint8Array>;
|
||||
}
|
||||
export declare class Ed25519Keypair {
|
||||
static fromLibsodiumPrivkey(libsodiumPrivkey: Uint8Array): Ed25519Keypair;
|
||||
readonly privkey: Uint8Array;
|
||||
readonly pubkey: Uint8Array;
|
||||
constructor(privkey: Uint8Array, pubkey: Uint8Array);
|
||||
toLibsodiumPrivkey(): Uint8Array;
|
||||
}
|
||||
export declare class Ed25519 {
|
||||
/**
|
||||
* Generates a keypair deterministically from a given 32 bytes seed.
|
||||
*
|
||||
* This seed equals the Ed25519 private key.
|
||||
* For implementation details see crypto_sign_seed_keypair in
|
||||
* https://download.libsodium.org/doc/public-key_cryptography/public-key_signatures.html
|
||||
* and diagram on https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/
|
||||
*/
|
||||
static makeKeypair(seed: Uint8Array): Promise<Ed25519Keypair>;
|
||||
static createSignature(message: Uint8Array, keyPair: Ed25519Keypair): Promise<Uint8Array>;
|
||||
static verifySignature(signature: Uint8Array, message: Uint8Array, pubkey: Uint8Array): Promise<boolean>;
|
||||
}
|
||||
/**
|
||||
* Nonce length in bytes for all flavours of XChaCha20.
|
||||
*
|
||||
* @see https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xchacha20#notes
|
||||
*/
|
||||
export declare const xchacha20NonceLength = 24;
|
||||
export declare class Xchacha20poly1305Ietf {
|
||||
static encrypt(message: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise<Uint8Array>;
|
||||
static decrypt(ciphertext: Uint8Array, key: Uint8Array, nonce: Uint8Array): Promise<Uint8Array>;
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
export declare class Random {
|
||||
/**
|
||||
* Returns `count` cryptographically secure random bytes
|
||||
*/
|
||||
static getBytes(count: number): Uint8Array;
|
||||
}
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Ripemd160 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Ripemd160;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Ripemd160(data).digest()` */
|
||||
export declare function ripemd160(data: Uint8Array): Uint8Array;
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
import { ExtendedSecp256k1Signature, Secp256k1Signature } from "./secp256k1signature";
|
||||
export interface Secp256k1Keypair {
|
||||
readonly pubkey: Uint8Array;
|
||||
readonly privkey: Uint8Array;
|
||||
}
|
||||
export declare class Secp256k1 {
|
||||
static makeKeypair(privkey: Uint8Array): Promise<Secp256k1Keypair>;
|
||||
static createSignature(messageHash: Uint8Array, privkey: Uint8Array): Promise<ExtendedSecp256k1Signature>;
|
||||
static verifySignature(
|
||||
signature: Secp256k1Signature,
|
||||
messageHash: Uint8Array,
|
||||
pubkey: Uint8Array,
|
||||
): Promise<boolean>;
|
||||
static recoverPubkey(signature: ExtendedSecp256k1Signature, messageHash: Uint8Array): Uint8Array;
|
||||
static compressPubkey(pubkey: Uint8Array): Uint8Array;
|
||||
static trimRecoveryByte(signature: Uint8Array): Uint8Array;
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
export declare class Secp256k1Signature {
|
||||
/**
|
||||
* Takes the pair of integers (r, s) as 2x32 byte of binary data.
|
||||
*
|
||||
* Note: This is the format Cosmos SDK uses natively.
|
||||
*
|
||||
* @param data a 64 byte value containing integers r and s.
|
||||
*/
|
||||
static fromFixedLength(data: Uint8Array): Secp256k1Signature;
|
||||
static fromDer(data: Uint8Array): Secp256k1Signature;
|
||||
private readonly data;
|
||||
constructor(r: Uint8Array, s: Uint8Array);
|
||||
r(length?: number): Uint8Array;
|
||||
s(length?: number): Uint8Array;
|
||||
toFixedLength(): Uint8Array;
|
||||
toDer(): Uint8Array;
|
||||
}
|
||||
/**
|
||||
* A Secp256k1Signature plus the recovery parameter
|
||||
*/
|
||||
export declare class ExtendedSecp256k1Signature extends Secp256k1Signature {
|
||||
/**
|
||||
* Decode extended signature from the simple fixed length encoding
|
||||
* described in toFixedLength().
|
||||
*/
|
||||
static fromFixedLength(data: Uint8Array): ExtendedSecp256k1Signature;
|
||||
readonly recovery: number;
|
||||
constructor(r: Uint8Array, s: Uint8Array, recovery: number);
|
||||
/**
|
||||
* A simple custom encoding that encodes the extended signature as
|
||||
* r (32 bytes) | s (32 bytes) | recovery param (1 byte)
|
||||
* where | denotes concatenation of bonary data.
|
||||
*/
|
||||
toFixedLength(): Uint8Array;
|
||||
}
|
||||
Vendored
-28
@@ -1,28 +0,0 @@
|
||||
import { HashFunction } from "./hash";
|
||||
export declare class Sha1 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha1;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha1(data).digest()` */
|
||||
export declare function sha1(data: Uint8Array): Uint8Array;
|
||||
export declare class Sha256 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha256;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha256(data).digest()` */
|
||||
export declare function sha256(data: Uint8Array): Uint8Array;
|
||||
export declare class Sha512 implements HashFunction {
|
||||
readonly blockSize: number;
|
||||
private readonly impl;
|
||||
constructor(firstData?: Uint8Array);
|
||||
update(data: Uint8Array): Sha512;
|
||||
digest(): Uint8Array;
|
||||
}
|
||||
/** Convenience function equivalent to `new Sha512(data).digest()` */
|
||||
export declare function sha512(data: Uint8Array): Uint8Array;
|
||||
Vendored
-67
@@ -1,67 +0,0 @@
|
||||
import { Uint32 } from "@cosmjs/math";
|
||||
export interface Slip10Result {
|
||||
readonly chainCode: Uint8Array;
|
||||
readonly privkey: Uint8Array;
|
||||
}
|
||||
/**
|
||||
* Raw values must match the curve string in SLIP-0010 master key generation
|
||||
*
|
||||
* @see https://github.com/satoshilabs/slips/blob/master/slip-0010.md#master-key-generation
|
||||
*/
|
||||
export declare enum Slip10Curve {
|
||||
Secp256k1 = "Bitcoin seed",
|
||||
Ed25519 = "ed25519 seed",
|
||||
}
|
||||
/**
|
||||
* Reverse mapping of Slip10Curve
|
||||
*/
|
||||
export declare function slip10CurveFromString(curveString: string): Slip10Curve;
|
||||
export declare class Slip10RawIndex extends Uint32 {
|
||||
static hardened(hardenedIndex: number): Slip10RawIndex;
|
||||
static normal(normalIndex: number): Slip10RawIndex;
|
||||
isHardened(): boolean;
|
||||
}
|
||||
/**
|
||||
* An array of raw SLIP10 indices.
|
||||
*
|
||||
* This can be constructed via string parsing:
|
||||
*
|
||||
* ```ts
|
||||
* import { stringToPath } from "@cosmjs/crypto";
|
||||
*
|
||||
* const path = stringToPath("m/0'/1/2'/2/1000000000");
|
||||
* ```
|
||||
*
|
||||
* or manually:
|
||||
*
|
||||
* ```ts
|
||||
* import { HdPath, Slip10RawIndex } from "@cosmjs/crypto";
|
||||
*
|
||||
* // m/0'/1/2'/2/1000000000
|
||||
* const path: HdPath = [
|
||||
* Slip10RawIndex.hardened(0),
|
||||
* Slip10RawIndex.normal(1),
|
||||
* Slip10RawIndex.hardened(2),
|
||||
* Slip10RawIndex.normal(2),
|
||||
* Slip10RawIndex.normal(1000000000),
|
||||
* ];
|
||||
* ```
|
||||
*/
|
||||
export declare type HdPath = readonly Slip10RawIndex[];
|
||||
export declare class Slip10 {
|
||||
static derivePath(curve: Slip10Curve, seed: Uint8Array, path: HdPath): Slip10Result;
|
||||
private static master;
|
||||
private static child;
|
||||
/**
|
||||
* Implementation of ser_P(point(k_par)) from BIP-0032
|
||||
*
|
||||
* @see https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
|
||||
*/
|
||||
private static serializedPoint;
|
||||
private static childImpl;
|
||||
private static isZero;
|
||||
private static isGteN;
|
||||
private static n;
|
||||
}
|
||||
export declare function pathToString(path: HdPath): string;
|
||||
export declare function stringToPath(input: string): HdPath;
|
||||
Reference in New Issue
Block a user