lotus-sdk
Version:
Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem
40 lines • 1.23 kB
TypeScript
import { BN } from './bn.js';
import { Signature } from './signature.js';
import { PrivateKey } from '../privatekey.js';
import { PublicKey } from '../publickey.js';
export interface SchnorrData {
hashbuf?: Buffer;
endian?: 'little' | 'big';
privkey?: PrivateKey;
pubkey?: PublicKey;
sig?: Signature;
verified?: boolean;
}
export declare class Schnorr {
hashbuf: Buffer;
endian: 'little' | 'big';
privkey: PrivateKey;
pubkey: PublicKey;
sig: Signature;
verified: boolean;
constructor(obj?: SchnorrData);
set(obj: SchnorrData): Schnorr;
privkey2pubkey(): Schnorr;
toPublicKey(): PublicKey;
sign(): Schnorr;
_findSignature(d: BN, e: BN): {
r: BN;
s: BN;
compressed?: boolean;
isSchnorr?: boolean;
};
private getrBuffer;
private getsBuffer;
sigError(): boolean;
verify(): Schnorr;
nonceFunctionRFC6979(privkey: Buffer, msgbuf: Buffer): BN;
static sign(hashbuf: Buffer, privkey: PrivateKey, endian?: 'little' | 'big'): Signature;
static verify(hashbuf: Buffer, sig: Signature, pubkey: PublicKey, endian?: 'little' | 'big'): boolean;
private reverseBuffer;
}
//# sourceMappingURL=schnorr.d.ts.map