@rmf1723/schnorrkel
Version:
Schnorr signatures in the ristretto255 curve
43 lines • 1.43 kB
TypeScript
import { Transcript } from '@rmf1723/merlin';
import { Point, Scalar } from '@rmf1723/ristretto255';
declare const ctorKey: unique symbol;
export { Transcript as SigningContext } from '@rmf1723/merlin';
export type KeySeed = Uint8Array;
export declare function randomKeySeed(): KeySeed;
export declare function expandKey(seed: KeySeed): SecretKey;
declare const _default: {
randomKeySeed: typeof randomKeySeed;
expandKey: typeof expandKey;
};
export default _default;
export declare class SecretKey {
#private;
constructor(key: typeof ctorKey, exponent: Scalar, nonce: Uint8Array);
get publicKey(): PublicKey;
get exponent(): Scalar;
get nonce(): Uint8Array;
toBytes(): Uint8Array;
static fromBytes(buf: ArrayBufferView): SecretKey;
sign(context: Transcript): Signature;
}
export declare class PublicKey {
#private;
constructor(point: Point);
get point(): Point;
toBytes(): Uint8Array;
static fromBytes(buf: ArrayBufferView): PublicKey;
verify(context: Transcript, sig: Signature): typeof ACCEPT;
}
export declare class Signature {
#private;
constructor(R: Point, s: Scalar);
get R(): Point;
get s(): Scalar;
toBytes(): Uint8Array;
static fromBytes(buf: ArrayBufferView): Signature;
}
export declare const ACCEPT: "ACCEPT";
export declare class SignatureError extends Error {
constructor();
}
//# sourceMappingURL=schnorrkel.d.ts.map