Consider the following example:
Suppose I have a function ADD written in C language that adds two integers int A and int B and returns the sum C. Now, I want to verify that my function ADD worked correctly using the Ethereum blockchain.
To do so, I deployed a simple smart contract on the Ethereum blockchain that has a function called Verify ((A,B),C) that returns true if verification holds, false otherwise. For this verification, I want to pass two parameters to the Verify function. The first parameter should be the inputs and the second parameter will be the output of my ADD function.
The Verify function will be executed on (A,B), generate output C' and compare it with C. If C'== C, return true, else return false. Now, for the above example, my question is following:
- How to translate the compiled binary code of my C program to EVM code? In other words, if I consider (A,B,0) as state 1 output and (A,B,C) as state 2 output of my program in C, then how can I convert each state to EVM bytecode so that, EVM start execution from state1 and ends at state2?