@tokamak-zk-evm/synthesizer
Version:
Tokamak zk-EVM Synthesizer - Processes Ethereum transactions into wire maps for Tokamak zk-SNARK proof generation
77 lines • 2.73 kB
TypeScript
import type { RunState } from '../../interpreter.js';
import type { DataPt } from '../types/index.js';
/**
* Class responsible for Synthesizer-related validations
*/
export declare class SynthesizerValidator {
/**
* Validates if the input count matches the expected count
*
* @param name Operator name
* @param actual Actual input count
* @param expected Expected input count
* @throws {InvalidInputCountError} If input count doesn't match
*/
static validateInputCount(name: string, actual: number, expected: number): void;
/**
* Validates if the subcircuit name is valid
*
* @param name Subcircuit name
* @param validNames List of valid subcircuit names
* @throws {UndefinedSubcircuitError} If subcircuit name is invalid
*/
static validateSubcircuitName(name: string, validNames: string[]): void;
/**
* Validates if the given opcode is implemented
* @param opcode Opcode to validate
* @throws {Error} If opcode is not implemented
*/
static validateImplementedOpcode(opcode: string): void;
/**
* Validates that the opcode is implemented
* @param opcode The opcode number
* @param opcodeName The opcode name
* @throws Error if the opcode is not implemented
*/
static validateOpcodeImplemented(opcode: number, opcodeName: string): void;
/**
* Validates if the inputs are valid
*
* @param inputs Array of inputs to validate
* @throws {Error} If input is null or undefined
*/
static validateInputs(inputs: DataPt[]): void;
/**
* Validates number range
*
* @param value Value to validate
* @param min Minimum value
* @param max Maximum value
* @param paramName Parameter name
* @throws {Error} If value is out of range
*/
static validateRange(value: number | bigint, min: number | bigint, max: number | bigint, paramName: string): void;
/**
* Validates if the value is within Ethereum word size limits
* @param value Value to validate
* @throws {Error} If value is negative or exceeds word size
*/
static validateValue(value: bigint): void;
}
export declare class SynthesizerInstructionValidator {
private runState;
constructor(runState: RunState);
/**
* Validates arithmetic inputs
*/
validateArithInputs(inPts: DataPt[], ins: bigint[], op: string): void;
/**
* Validates arithmetic output
*/
validateArithOutput(outPt: DataPt, expectedValue: bigint, op: string): void;
/**
* Validates Keccak256 data
*/
validateKeccakData(offset: number, length: number, mutDataPt: DataPt): void;
}
//# sourceMappingURL=validator.d.ts.map