RSA signature verification: Inputs to Precompile contract

by Sanjay S B   Last Updated October 09, 2019 12:28 PM - source

I am trying to verify an RSA signature using Ethereum smart contract. I have some doubts regarding my design.

I am using the precompile at address 0X05 to generate s^e mod n, where s is the signature to be verified, e is the exponent used during key generation. n is the public Key. I understand that I have to provide s, e and n as uint256.

Reference.

I will compare the value obtained as output from precompile to compare with the original message's hex. Is this the right way?

I am able to get e as a number in JavaScript but s and n I have are buffers. how do I convert them to integer to use in the smart contract invocation?



Related Questions




How to call "modexp" precompiled contract from solidity?

Updated September 14, 2018 04:28 AM

Very high gas costs

Updated November 24, 2018 00:28 AM

How do private members work?

Updated November 28, 2017 11:28 AM