416 Commits

Author SHA1 Message Date
Al-Kindi-0
d2a6739605 feat: derandomize RPO-STARK DSA (#358) 2025-01-08 11:42:23 -08:00
Al-Kindi-0
cae87a2790 chore: add signatures benchmarks (#354) 2024-12-12 19:58:33 -08:00
Al-Kindi-0
335c50f54d feat: implement RPO STARK-based signature DSA (with zero knowledge) (#349) 2024-12-12 19:33:24 -08:00
Qyriad
b151773b0d feat: implement concurrent Smt construction (#341)
* merkle: add parent() helper function on NodeIndex
* smt: add pairs_to_leaf() to trait
* smt: add sorted_pairs_to_leaves() and test for it
* smt: implement single subtree-8 hashing, w/ benchmarks & tests

This will be composed into depth-8-subtree-based computation of entire
sparse Merkle trees.

* merkle: add a benchmark for constructing 256-balanced trees

This is intended for comparison with the benchmarks from the previous
commit. This benchmark represents the theoretical perfect-efficiency
performance we could possibly (but impractically) get for computing
depth-8 sparse Merkle subtrees.

* smt: test that SparseMerkleTree::build_subtree() is composable

* smt: test that subtree logic can correctly construct an entire tree

This commit ensures that `SparseMerkleTree::build_subtree()` can
correctly compose into building an entire sparse Merkle tree, without
yet getting into potential complications concurrency introduces.

* smt: implement test for basic parallelized subtree computation w/ rayon

Building on the previous commit, this commit implements a test proving
that `SparseMerkleTree::build_subtree()` can be composed into itself not
just concurrently, but in parallel, without issue.

* smt: add from_raw_parts() to trait interface

This commit adds a new required method to the SparseMerkleTree trait,
to allow generic construction from pre-computed parts.

This will be used to add a generic version of `with_entries()` in a
later commit.

* smt: add parallel constructors to Smt and SimpleSmt

What the previous few commits have been leading up to: SparseMerkleTree
now has a function to construct the tree from existing data in parallel.
This is significantly faster than the singlethreaded equivalent.
Benchmarks incoming!

---------

Co-authored-by: krushimir <krushimir@reilabs.co>
Co-authored-by: krushimir <kresimir.grofelnik@reilabs.io>
2024-12-04 10:54:41 -08:00
Bobbin Threadbare
1867f842d3 chore: update changelog 2024-11-24 22:26:51 -08:00
Al-Kindi-0
e1072ecc7f chore: update to winterfell dependencies to 0.11 (#346) 2024-11-24 22:20:19 -08:00
Bobbin Threadbare
063ad49afd chore: update crate version to v0.13.0 2024-11-21 15:56:55 -08:00
Philipp Gackstatter
a27f9ad828 refactor: use thiserror to derive errors and update error messages (#344) 2024-11-21 15:52:20 -08:00
Al-Kindi-0
50dd6bda19 fix: skip using the field element containing the proof-of-work (#343) 2024-11-18 00:16:27 -08:00
Bobbin Threadbare
ee20a49953 chore: increment crate version to v0.12.0 and update changelog 2024-10-30 15:04:08 -07:00
Al-Kindi-0
0d75e3593b chore: migrate to Winterfell v0.10.0 release (#338) 2024-10-29 15:02:46 -07:00
Bobbin Threadbare
689cc93ed1 chore: update crate version to v0.11.0 and set MSRV to 1.82 2024-10-17 23:16:41 -07:00
Bobbin Threadbare
7970d3a736 Merge branch 'main' into next 2024-10-17 20:53:09 -07:00
Al-Kindi-0
a734dace1e feat: update RPO's padding rule to use that in the xHash paper (#318) 2024-10-17 20:49:44 -07:00
Andrey Khmuro
940cc04670 feat: add Smt::is_empty (#337) 2024-10-17 14:27:50 -07:00
Andrey Khmuro
e82baa35bb feat: return error instead of panic during MMR verification (#335) 2024-10-17 07:23:29 -07:00
Bobbin Threadbare
876d1bf97a chore: update crate version v0.10.3 2024-09-26 09:37:34 -07:00
Philipp Gackstatter
8adc0ab418 feat: implement get_size_hint for Smt (#331) 2024-09-26 09:13:50 -07:00
Bobbin Threadbare
c2eb38c236 chore: increment crate version to v0.10.2 2024-09-25 03:05:33 -07:00
Philipp Gackstatter
a924ac6b81 feat: Add size hint for digests (#330) 2024-09-25 03:03:31 -07:00
Bobbin Threadbare
e214608c85 fix: bug introduced due to merging 2024-09-13 11:10:34 -07:00
Bobbin Threadbare
c44ccd9dec Merge branch 'main' into next 2024-09-13 11:01:04 -07:00
Bobbin Threadbare
e34900c7d8 chore: update version to v0.10.1 v0.10.1 2024-09-13 10:58:06 -07:00
Santiago Pittella
2b184cd4ca feat: add de/serialization to InOrderIndex and PartialMmr (#329) 2024-09-13 08:47:46 -07:00
Bobbin Threadbare
913384600d chore: fix typos 2024-09-11 16:52:21 -07:00
Qyriad
ae807a47ae feat: implement transactional Smt insertion (#327)
* feat(smt): impl constructing leaves that don't yet exist

This commit implements 'prospective leaf construction' -- computing
sparse Merkle tree leaves for a key-value insertion without actually
performing that insertion.

For SimpleSmt, this is trivial, since the leaf type is simply the value
being inserted.

For the full Smt, the new leaf payload depends on the existing payload
in that leaf. Since almost all leaves are very small, we can just clone
the leaf and modify a copy.

This will allow us to perform more general prospective changes on Merkle
trees.

* feat(smt): export get_value() in the trait

* feat(smt): implement generic prospective insertions

This commit adds two methods to SparseMerkleTree: compute_mutations()
and apply_mutations(), which respectively create and consume a new
MutationSet type. This type represents as set of changes to a
SparseMerkleTree that haven't happened yet, and can be queried on to
ensure a set of insertions result in the correct tree root before
finalizing and committing the mutation.

This is a direct step towards issue 222, and will directly enable
removing Merkle tree clones in miden-node InnerState::apply_block().

As part of this change, SparseMerkleTree now requires its Key to be Ord
and its Leaf to be Clone (both bounds which were already met by existing
implementations). The Ord bound could instead be changed to Eq + Hash,
if MutationSet were changed to use a HashMap instead of a BTreeMap.

* chore(smt): refactor empty node construction to helper function
2024-09-11 16:49:57 -07:00
Paul-Henry Kajfasz
f4a9d5b027 Merge pull request #323 from 0xPolygonMiden/phklive-consistent-ci
Update `Makefile` and `CI`
2024-08-22 08:22:20 -07:00
Paul-Henry Kajfasz
ee42d87121 Replace i. by 1. 2024-08-22 16:14:19 +01:00
Paul-Henry Kajfasz
b1cb2b6ec3 Fix comments 2024-08-22 15:21:59 +01:00
Paul-Henry Kajfasz
e4a9a2ac00 Updated test in workflow 2024-08-21 16:53:28 +01:00
Paul-Henry Kajfasz
c5077b1683 updated readme 2024-08-21 14:18:41 +01:00
Paul-Henry Kajfasz
2e74028fd4 Updated makefile 2024-08-21 14:11:17 +01:00
Paul-Henry Kajfasz
8bf6ef890d fmt 2024-08-21 14:04:23 +01:00
Paul-Henry Kajfasz
e2aeb25e01 Updated doc comments 2024-08-21 14:03:43 +01:00
Paul-Henry Kajfasz
790846cc73 Merge next 2024-08-21 09:29:39 +01:00
Paul-Henry Kajfasz
4cb6bed428 Updated changelog + added release to no-std 2024-08-19 14:37:58 +01:00
Bobbin Threadbare
a12e62ff22 feat: improve MMR api (#324) 2024-08-18 09:35:12 -07:00
Paul-Henry Kajfasz
9aa4987858 Merge branch 'phklive-consistent-ci' of github.com:0xPolygonMiden/crypto into phklive-consistent-ci 2024-08-16 17:29:29 -07:00
Paul-Henry Kajfasz
70a0a1e970 Removed Makefile.toml 2024-08-16 17:29:09 -07:00
Paul-Henry Kajfasz
025fbb66a9 Update README.md change miden-crypto to crypto 2024-08-17 01:21:19 +01:00
Paul-Henry Kajfasz
5ee5e8554b Ran pre-commit 2024-08-16 16:12:17 -07:00
Paul-Henry Kajfasz
ac3c6976bd Updated Changelog + pre commit 2024-08-16 16:09:51 -07:00
Paul-Henry Kajfasz
374a10f340 Updated ci + added scripts 2024-08-16 15:32:03 -07:00
Paul-Henry Kajfasz
ad0f472708 Updated Makefile and Readme 2024-08-16 15:07:27 -07:00
Bobbin Threadbare
8bb893345b chore: update rust version badge v0.10.0 2024-08-06 17:00:17 -07:00
Bobbin Threadbare
d92fae7f82 chore: update rust version badge 2024-08-06 16:59:31 -07:00
Bobbin Threadbare
b171575776 merge v0.10.0 release 2024-08-06 16:58:00 -07:00
Bobbin Threadbare
dfdd5f722f chore: fix lints 2024-08-06 16:52:46 -07:00
Bobbin Threadbare
9f63b50510 chore: increment crate version to v0.10.0 and update changelog 2024-08-06 16:42:50 -07:00
Elias Rad
d6ab367d32 chore: fix typos (#321) 2024-07-24 11:35:57 -07:00