near / nearcore

Reference client for NEAR Protocol
https://near.org
GNU General Public License v3.0
2.34k stars 632 forks source link

Feature Request: SHA3-256 FIPS 202 and ECRecover Uncompressed Public key precompile to Math API #4285

Open MuhammedIrfan opened 3 years ago

MuhammedIrfan commented 3 years ago
      1. Description As part of enabling interoperability between NEAR Protocol and ICON Blockchain we would need to implement SHA3-256 FIPS 202 hash precompile and ECRecover Uncompressed public key precompile to Runtime Logics.
      1. Rationale
      1. Example Test cases done to check the input and output of the functions for the given parameters below

sha3_256 params value : ‘0x0448250ebe88d77e0a12bcf530fe6a2cf1ac176945638d309b840d631940c93b78c2bd6d16f227a8877e3f1604cd75b9c5a8ab0cac95174a8a0a0f8ea9e4c10bca’ returns : ‘0xc7647f7e251bf1bd70863c8693e93a4e77dd0c9a689073e987d51254317dc704’

ecrecover_public_key params hash : ‘0xc5d6c454e4d7a8e8a654f5ef96e8efe41d21a65b171b298925414aa3dc061e37’ v : ‘0x00’ r : ‘0x4011de30c04302a2352400df3d1459d6d8799580dceb259f45db1d99243a8d0c’ s : ‘0x64f548b7776cb93e37579b830fc3efce41e12e0958cda9f8c5fcad682c610795’ returns : ‘0x0448250ebe88d77e0a12bcf530fe6a2cf1ac176945638d309b840d631940c93b78c2bd6d16f227a8877e3f1604cd75b9c5a8ab0cac95174a8a0a0f8ea9e4c10bca’

      1. Changes
      1. References https://csrc.nist.gov/publications/detail/fips/202/final https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm#Public_key_recovery
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.