Add Crypto.ecverify #502
@ -148,10 +148,12 @@ global_env() ->
|
|||||||
{["Map", "delete"], Fun([K, Map(K, V)], Map(K, V))},
|
{["Map", "delete"], Fun([K, Map(K, V)], Map(K, V))},
|
||||||
{["Map", "member"], Fun([K, Map(K, V)], Bool)},
|
{["Map", "member"], Fun([K, Map(K, V)], Bool)},
|
||||||
{["Map", "size"], Fun1(Map(K, V), Int)},
|
{["Map", "size"], Fun1(Map(K, V), Int)},
|
||||||
|
%% Crypto/Curve operations
|
||||||
|
{["Crypto", "ecverify"], Fun([Hash, Address, SignId], Bool)},
|
||||||
%% Strings
|
%% Strings
|
||||||
{["String", "length"], Fun1(String, Int)},
|
{["String", "length"], Fun1(String, Int)},
|
||||||
{["String", "concat"], Fun([String, String], String)},
|
{["String", "concat"], Fun([String, String], String)},
|
||||||
{["String", "sha3"], Fun1(String, Int)},
|
{["String", "sha3"], Fun1(String, Hash)},
|
||||||
%% Conversion
|
%% Conversion
|
||||||
{["Int", "to_str"], Fun1(Int, String)},
|
{["Int", "to_str"], Fun1(Int, String)},
|
||||||
{["Address", "to_str"], Fun1(Address, String)}
|
{["Address", "to_str"], Fun1(Address, String)}
|
||||||
|
@ -316,6 +316,12 @@ ast_body({map, _, Map, [Upd]}, Icode) ->
|
|||||||
ast_body({map, Ann, Map, [Upd | Upds]}, Icode) ->
|
ast_body({map, Ann, Map, [Upd | Upds]}, Icode) ->
|
||||||
ast_body({map, Ann, {map, Ann, Map, [Upd]}, Upds}, Icode);
|
ast_body({map, Ann, {map, Ann, Map, [Upd]}, Upds}, Icode);
|
||||||
|
|
||||||
|
%% Crypto
|
||||||
|
ast_body(?qid_app(["Crypto", "ecverify"], [Msg, PK, Sig], _, _), Icode) ->
|
||||||
|
prim_call(?PRIM_CALL_CRYPTO_ECVERIFY, #integer{value = 0},
|
||||||
|
[ast_body(Msg, Icode), ast_body(PK, Icode), ast_body(Sig, Icode)],
|
||||||
|
[word, word, sign_t()], word);
|
||||||
|
|
||||||
%% Strings
|
%% Strings
|
||||||
%% -- String length
|
%% -- String length
|
||||||
ast_body(?qid_app(["String", "length"], [String], _, _), Icode) ->
|
ast_body(?qid_app(["String", "length"], [String], _, _), Icode) ->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user