0
votes

I'm working on solidity smart contract for Ethereum. I need to run some cryptographic verification algorithm before making transaction. This algorithm is implemented in C++.

How I can call this code from inside smart contract?

Let's say I have fallowing C++ code(but in practice it is much more complex)

int foo(int a, int b, int n){
    if(pow(a,b)%n == 1)
        return true;
    else
        return false;
}

And if this code return's true I need to make transaction

    msg.reciever.addr.send(amount);

Is there any solution I can use in order to combine Ethereum's smart contacts and complex self-implemented cryptography which should be done inside of blockchain? How to make a bridge between blockchain and outside library.

1

1 Answers