/** * @typedef {Uint8Array} Scalar A scalar type, which wraps * raw byte representation of halo2curves::bn256::Fr. * It also exposes a method to convert unsigned BigInt to scalar. */ import { Address } from "viem"; export declare const r = 21888242871839275222246405745257275088548364400416034343698204186575808495617n; export declare class Scalar { bytes: Uint8Array; /** * @param bytes the bytes of the scalar in little-endian form * @throws if the bytes are not 32 bytes long * use only when wrapping WASM-produced scalar output */ constructor(bytes: Uint8Array); /** * Converts a bigint to a scalar. * A value is convertible to scalar type if it is a non-negative integer less than r. * * @param value the value to convert * @returns the value as a scalar * @throws if the value is not convertible to scalar */ static fromBigint(value: bigint): Scalar; /** * Converts an ethereum address to a scalar. * @param address ethereum address * @returns scalar representation of the address * @throws if the address is incorrect (not 20 bytes hex string) */ static fromAddress(address: Address): Scalar; } /** * Checks if a value is convertible to scalar type. * A value is convertible to scalar type if it is a non-negative integer less than r. * * @param value the value to check * @returns if the value is convertible to scalar type */ export declare function isBigintScalar(value: bigint): boolean; export declare function scalarToBigint(scalar: Scalar): bigint; export declare function scalarsEqual(a: Scalar, b: Scalar): boolean;