Compare commits

..

1 Commits

Author SHA1 Message Date
Ulf Wiger 54dc140629 Add opcodes for ML-DSA verify functions
Gajumaru Bytecode Tests / tests (push) Successful in -3m51s
2026-01-29 18:17:06 +01:00
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
{deps, [ {eblake2, "1.0.0"}
, {gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
{tag, "v1.2.0"}}}
{ref, "9d2ecc00d32ea295309563e54a81636ecb597e96"}}}
, {getopt, "1.0.1"}
]}.
+1 -1
View File
@@ -11,7 +11,7 @@
{<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},0},
{<<"gmserialization">>,
{git,"https://git.qpq.swiss/QPQ-AG/gmserialization.git",
{ref,"ac64e01b0f675c1a34c70a827062f381920742db"}},
{ref,"9d2ecc00d32ea295309563e54a81636ecb597e96"}},
0}]}.
[
{pkg_hash,[
+4
View File
@@ -247,6 +247,10 @@ ops_defs() ->
, { 'INT_TO_BYTES', 16#b4, false, true, true, ?GAS(10), [a, a, a], int_to_bytes, {integer, integer}, bytes, "Arg0 := turn integer Arg1 into a byte array (big endian) length Arg2 (truncating if not fit)."}
, { 'STR_TO_BYTES', 16#b5, false, true, true, ?GAS(10), [a, a], str_to_bytes, {integer}, bytes, "Arg0 := turn string Arg1 into the corresponding byte array."}
, { 'NETWORK_ID', 16#b6, false, true, true, ?GAS(10), [a], network_id, {}, string, "Arg0 := The network_id of the chain."}
%% Gas estimates based on simple verify benchmarks: ed25519 (?GAS(1300)): 41µs, mldsa44: 75µs, mldsa65: 113µs, mldsa87: 179µs
, { 'VERIFY_SIG_MLDSA44', 16#b7, false, true, true, ?GAS(2340), [a,a,a,a], verify_sig_mldsa44, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa44(Hash, Pubkey, Signature)"}
, { 'VERIFY_SIG_MLDSA65', 16#b8, false, true, true, ?GAS(3640), [a,a,a,a], verify_sig_mldsa65, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa65(Hash, Pubkey, Signature)"}
, { 'VERIFY_SIG_MLDSA87', 16#b9, false, true, true, ?GAS(5720), [a,a,a,a], verify_sig_mldsa87, {bytes, bytes, bytes}, boolean, "Arg0 := verify_sig_mldsa87(Hash, Pubkey, Signature)"}
, { 'DBG_LOC', 16#f0, false, true, true, ?GAS(0), [a, a], dbg_loc, {string, integer}, none, "Debug Op: Execution location. Args = {file_name, line_num}" }
, { 'DBG_DEF', 16#f1, false, true, true, ?GAS(0), [a, a], dbg_def, {string, any}, none, "Debug Op: Define a variable. Args = {var_name, register}" }
+1 -1
View File
@@ -13,7 +13,7 @@ all() ->
roundtrip_identy(_Cfg) ->
CodeDir = code:lib_dir(gmbytecode, test),
FileName = filename:join(CodeDir, "asm_code/identity.gmsm"),
FileName = filename:join(CodeDir, "asm_code/identity.aesm"),
Code = gmb_asm:file(FileName, []),
ct:log("Code ~p:~n~s~n", [FileName, gmb_disassemble:format(Code, fun io:format/2)]),
ok.