Merge pull request #11 from aeternity/PT-163083710-implement_ecverify
Add Crypto.ecverify
This commit is contained in:
commit
4bedbfee61
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
%% NOTE: When possible deps are referenced by Git ref to ensure consistency between builds.
|
%% NOTE: When possible deps are referenced by Git ref to ensure consistency between builds.
|
||||||
{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git",
|
{deps, [ {aebytecode, {git, "https://github.com/aeternity/aebytecode.git",
|
||||||
{ref,"99bf097"}}}
|
{ref,"19d0e3e"}}}
|
||||||
]}.
|
]}.
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
[{<<"aebytecode">>,
|
[{<<"aebytecode">>,
|
||||||
{git,"https://github.com/aeternity/aebytecode.git",
|
{git,"https://github.com/aeternity/aebytecode.git",
|
||||||
{ref,"99bf097759dedbe7553f87a796bc7e1c7322e64b"}},
|
{ref,"19d0e3ee8493ac2a8f041636445734bade45d65f"}},
|
||||||
0}].
|
0}].
|
||||||
|
@ -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