Crates.io | tasm-lib |
lib.rs | tasm-lib |
version | 0.1.0 |
source | src |
created_at | 2023-07-06 12:41:35.492545 |
updated_at | 2023-07-06 12:41:35.492545 |
description | Code snippets for Triton VM assembly with tests and statistics. |
homepage | |
repository | |
max_upload_size | |
id | 909815 |
size | 1,116,956 |
This repository contains a collection of functions written in Triton VM assembly (tasm). The functions supplied here emulate the standard library of other programming languages: basic functions that are used a lot.
There are two big projects to be written in tasm. They are not contained in this repository. These projects are:
This repository helps to benchmark snippets written in tasm in order to gauge the complexity of the (Triton VM) prover.
Please place code in the appropriate directories, or create them if non-existent.
A u64
type is stored on the stack as two u32
elements that Triton VM provides native support for. A u64
is stored with the least significant part on top of the stack and the most significant part below it. So if the least significant part is st0
, then the most significant part is stored in st1
.
1st element is a length indicator that specifies the authentication path length in number of digests. The length indicator must be a valid u32
. Then follows the digests. The digests are ordered as: [digest_0_element_4,digest_0_element_3, digest_0_element_2, digest_0_element_1, digest_0_element_0, digest_1_element_4, digest_1_element_3 ... ]
.
Runtimes are printed in the JSON files in the benchmarks
directory. These are generated by tests labeled as benchmark
. If you manage to lower any of the numbers by changing a TASM snippet, please
make a pull request, so we can get more efficient algorithms :)