[PT-167805291] Add opcode for ecrecover (#122)

* Add opcode for ecrecover

* Update aebytecode

* Extend signature bytes type used for ecrecover

* Add ecrecover to changelog

* Add some type specs

* Please dialyzer
This commit is contained in:
Tino Breddin
2019-08-14 21:02:46 +02:00
committed by Hans Svensson
parent b669d2df1e
commit dd26649f7d
9 changed files with 51 additions and 34 deletions
+7 -4
View File
@@ -33,7 +33,8 @@
string_concat | bits_set | bits_clear | bits_test | bits_sum |
bits_intersection | bits_union | bits_difference |
contract_to_address | crypto_ecverify | crypto_ecverify_secp256k1 |
crypto_sha3 | crypto_sha256 | crypto_blake2b.
crypto_sha3 | crypto_sha256 | crypto_blake2b |
crypto_ecrecover_secp256k1.
-type flit() :: {int, integer()}
| {string, binary()}
@@ -187,8 +188,8 @@ builtins() ->
{"revoke", 3}]},
{["Map"], [{"from_list", 1}, {"to_list", 1}, {"lookup", 2},
{"lookup_default", 3}, {"delete", 2}, {"member", 2}, {"size", 1}]},
{["Crypto"], [{"ecverify", 3}, {"ecverify_secp256k1", 3}, {"sha3", 1},
{"sha256", 1}, {"blake2b", 1}]},
{["Crypto"], [{"ecrecover_secp256k1", 2}, {"ecverify", 3}, {"ecverify_secp256k1", 3},
{"sha3", 1}, {"sha256", 1}, {"blake2b", 1}]},
{["Auth"], [{"tx_hash", none}]},
{["String"], [{"length", 1}, {"concat", 2}, {"sha3", 1}, {"sha256", 1}, {"blake2b", 1}]},
{["Bits"], [{"set", 2}, {"clear", 2}, {"test", 2}, {"sum", 1}, {"intersection", 2},
@@ -818,7 +819,9 @@ op_builtins() ->
string_length, string_concat, string_sha3, string_sha256, string_blake2b,
bits_set, bits_clear, bits_test, bits_sum, bits_intersection, bits_union,
bits_difference, int_to_str, address_to_str, crypto_ecverify,
crypto_ecverify_secp256k1, crypto_sha3, crypto_sha256, crypto_blake2b].
crypto_ecverify_secp256k1, crypto_sha3, crypto_sha256, crypto_blake2b,
crypto_ecrecover_secp256k1
].
builtin_to_fcode(require, [Cond, Msg]) ->
make_if(Cond, {tuple, []}, {builtin, abort, [Msg]});