Extend signature bytes type used for ecrecover
This commit is contained in:
parent
b0e07ef4e7
commit
03b45b2af3
@ -460,7 +460,7 @@ global_env() ->
|
|||||||
%% Crypto/Curve operations
|
%% Crypto/Curve operations
|
||||||
CryptoScope = #scope
|
CryptoScope = #scope
|
||||||
{ funs = MkDefs(
|
{ funs = MkDefs(
|
||||||
[{"ecrecover_secp256k1", Fun([Hash, Bytes(64)], Hash)},
|
[{"ecrecover_secp256k1", Fun([Hash, Bytes(65)], Hash)},
|
||||||
{"ecverify", Fun([Hash, Address, SignId], Bool)},
|
{"ecverify", Fun([Hash, Address, SignId], Bool)},
|
||||||
{"ecverify_secp256k1", Fun([Hash, Bytes(64), Bytes(64)], Bool)},
|
{"ecverify_secp256k1", Fun([Hash, Bytes(64), Bytes(64)], Bool)},
|
||||||
{"sha3", Fun1(A, Hash)},
|
{"sha3", Fun1(A, Hash)},
|
||||||
|
@ -353,7 +353,7 @@ ast_body({map, Ann, Map, [Upd | Upds]}, Icode) ->
|
|||||||
ast_body(?qid_app(["Crypto", "ecrecover_secp256k1"], [Msg, Sig], _, _), Icode) ->
|
ast_body(?qid_app(["Crypto", "ecrecover_secp256k1"], [Msg, Sig], _, _), Icode) ->
|
||||||
prim_call(?PRIM_CALL_CRYPTO_ECRECOVER_SECP256K1, #integer{value = 0},
|
prim_call(?PRIM_CALL_CRYPTO_ECRECOVER_SECP256K1, #integer{value = 0},
|
||||||
[ast_body(Msg, Icode), ast_body(Sig, Icode)],
|
[ast_body(Msg, Icode), ast_body(Sig, Icode)],
|
||||||
[word, sign_t()], word);
|
[word, bytes_t(65)], word);
|
||||||
|
|
||||||
ast_body(?qid_app(["Crypto", "ecverify"], [Msg, PK, Sig], _, _), Icode) ->
|
ast_body(?qid_app(["Crypto", "ecverify"], [Msg, PK, Sig], _, _), Icode) ->
|
||||||
prim_call(?PRIM_CALL_CRYPTO_ECVERIFY, #integer{value = 0},
|
prim_call(?PRIM_CALL_CRYPTO_ECVERIFY, #integer{value = 0},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user