import { Fr } from '@aztec/foundation/curves/bn254'; /** * Formats a buffer as an array of fields. Splits the input into 31-byte chunks, and stores each * of them into a field, omitting the field's first byte, then adds zero-fields at the end until the max length. * @param input - Input to format. * @param targetLength - Length of the target array in number of fields. * @returns A field with the total length in bytes, followed by an array of fields such that their concatenation is equal to the input buffer, followed by enough zeroes to reach targetLength. */ export declare function bufferAsFields(input: Buffer, targetLength: number): Fr[]; /** * Recovers a buffer from an array of fields previously encoded with bufferAsFields. * * The first field encodes the byte length of the original buffer. The remaining fields * each carry 31 bytes of payload (the leading byte of each 32-byte field element is skipped). * * If the declared byte length exceeds the bytes available from the payload fields, the result * is zero-padded to the full declared length. This is important for correctness when the field * array has been truncated (e.g. contract class logs reconstructed from blobs using a short * emittedLength): without padding, the resulting buffer would be shorter than declared, causing * bytecode commitment computations to diverge from what the circuit produced. * * @param fields - An output from bufferAsFields: [byteLength, ...payloadFields]. * @returns A buffer of exactly `byteLength` bytes. */ export declare function bufferFromFields(fields: Fr[]): Buffer; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVmZmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYWJpL2J1ZmZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFJcEQ7Ozs7OztHQU1HO0FBQ0gsd0JBQWdCLGNBQWMsQ0FBQyxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLEdBQUcsRUFBRSxFQUFFLENBY3hFO0FBRUQ7Ozs7Ozs7Ozs7Ozs7O0dBY0c7QUFDSCx3QkFBZ0IsZ0JBQWdCLENBQUMsTUFBTSxFQUFFLEVBQUUsRUFBRSxHQUFHLE1BQU0sQ0FjckQifQ==