diff --git a/packages/prover/src/utils/conversion.ts b/packages/prover/src/utils/conversion.ts index 1f143baf1bda..c809de5c4555 100644 --- a/packages/prover/src/utils/conversion.ts +++ b/packages/prover/src/utils/conversion.ts @@ -23,7 +23,8 @@ export function bufferToHex(buffer: Buffer | Uint8Array): string { } export function hexToBuffer(val: string): Buffer { - return Buffer.from(val.replace("0x", ""), "hex"); + const hexWithEvenLength = val.length % 2 ? `0${val}` : val; + return Buffer.from(hexWithEvenLength.replace("0x", ""), "hex"); } export function padLeft(v: T, length: number): T {