@runonflux/aa-schnorr-multisig-sdk
Version:
Account Abstraction Schnorr Multi-Signatures SDK
35 lines (34 loc) • 2.31 kB
TypeScript
import { KeyPair } from "../types";
import type { Hex } from "../accountAbstraction";
import type { HashFunction, InternalNoncePairs, InternalNonces, InternalPublicNonces, InternalSignature } from "./types";
/**
* Generate a pair of nonces (k and kTwo) needed for `internalMultiSigSign`.
* Schnorr signature scheme is linear where `k` and `kTwo` are function parameters.
*
* @returns InternalNoncePairs
*/
export declare const _generateNonce: () => InternalNoncePairs;
export declare const _concatTypedArrays: (publicKeys: Buffer[]) => Buffer;
export declare const _generateL: (publicKeys: Buffer[]) => string;
export declare const _aCoefficient: (publicKey: Buffer, L: string) => Buffer;
export declare const generateRandomKeys: () => KeyPair;
export declare const _hashPrivateKey: (privateKey: Buffer) => string;
export declare const _hashMessage: (message: string) => string;
export declare const _generatePublicNonces: (privateKey: Buffer) => {
privateNonceData: Pick<InternalNoncePairs, "k" | "kTwo">;
publicNonceData: InternalPublicNonces;
hash: string;
};
export declare const _restorePublicNonces: (privateKey: Buffer, kPrivateKey: Buffer, kTwoPrivateKey: Buffer) => {
privateNonceData: Pick<InternalNoncePairs, "k" | "kTwo">;
publicNonceData: InternalPublicNonces;
hash: string;
};
export declare const _multiSigSign: (nonces: InternalNonces, combinedPublicKey: Buffer, privateKey: Buffer, msg: string, publicKeys: Buffer[], publicNonces: InternalPublicNonces[], hashFn?: HashFunction) => InternalSignature;
export declare const _multiSigSignHash: (nonces: InternalNonces, combinedPublicKey: Buffer, privateKey: Buffer, hash: string, publicKeys: Buffer[], publicNonces: InternalPublicNonces[]) => InternalSignature;
export declare const _sumSigs: (signatures: Buffer[]) => Buffer;
export declare const _verify: (s: Buffer, msg: string, R: Buffer, publicKey: Buffer, hashFn?: HashFunction) => boolean;
export declare const _verifyHash: (s: Buffer, hash: string, R: Buffer, publicKey: Buffer) => boolean;
export declare const _generatePk: (combinedPublicKey: Buffer) => Hex;
export declare const _sign: (privateKey: Buffer, msg: string, hashFn?: HashFunction) => InternalSignature;
export declare const _signHash: (privateKey: Buffer, hash: string) => InternalSignature;