Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document key bits of SimpleSmt #65

Closed
Tracked by #64
vlopes11 opened this issue Feb 17, 2023 · 1 comment
Closed
Tracked by #64

Document key bits of SimpleSmt #65

vlopes11 opened this issue Feb 17, 2023 · 1 comment
Labels
good first issue Good for newcomers

Comments

@vlopes11
Copy link
Contributor

Currently, the key bits are documented as 63-bit

/// A sparse Merkle tree with 63-bit keys and 4-element leaf values, without compaction.
/// Manipulation and retrieval of leaves and internal nodes is provided by its internal `Store`.
/// The root of the tree is recomputed on each new leaf update.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SimpleSmt {

However, we take u64 as arguments. This difference might create a confusion downstream.

/// Inserts a leaf located at the specified key, and recomputes hashes by walking up the tree
pub fn insert_leaf(&mut self, key: u64, value: Word) -> Result<(), MerkleError> {

One option is to, instead, take a Felt as argument. But then, we also need to rework the rpo module documentation that also mentions 64-bit - and it is important we keep consistency between these, as RPO is the backend of SimpleSmt

/// The parameters used to instantiate the function are:
/// * Field: 64-bit prime field with modulus 2^64 - 2^32 + 1.
/// * State width: 12 field elements.
/// * Capacity size: 4 field elements.
/// * Number of founds: 7.
/// * S-Box degree: 7.

Originally posted by @grjte in #64 (comment)

@bobbinth
Copy link
Contributor

Closing as no longer relevant after #245.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants