import { BigNumberish, Uint256 } from "starknet"; import { ProjectivePoint, CipherBalance } from "./types.js"; export declare function bytesOrNumToBigInt(x: BigNumberish | Uint8Array): bigint; export declare function isUint256(x: number | bigint | Uint256): x is Uint256; export declare function castBigInt(x: number | bigint | Uint256): bigint; export declare function createCipherBalance(y: ProjectivePoint, amount: bigint, random: bigint): CipherBalance; /** * Decipher the given cipher balance with the given secret key. * This function has to bruteforce for `b` in `g^b`. It starts at `b = 0` and * ends in `b = 2^32`. * @param {bigint} x - The secret key * @param {ProjectivePoint} L - The left point of the cipher balance * @param {ProjectivePoint} R - The right point of the cipher balance * @returns {bigint} The deciphered balance * @throws {Error} If decryption fails * @todo Parametrize bit size */ export declare function decipherBalance(x: bigint, L: ProjectivePoint, R: ProjectivePoint): bigint; /** * Asserts that the given CipherBalance is a correct encryption for the public * key of the given private key x and the given balance. * @param {bigint} x - The private key * @param {bigint} balance - The expected balance * @param {ProjectivePoint} L - The left point of the cipher balance * @param {ProjectivePoint} R - The right point of the cipher balance * @returns {boolean} True if the assertion passes, false otherwise */ export declare function assertBalance(x: bigint, balance: bigint, L: ProjectivePoint, R: ProjectivePoint): boolean; export declare function pubKeyFromSecret(secret: bigint): import("./types.js").StarkPoint;