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

Add wrapper structure to work on #66

Closed
wants to merge 19 commits into from
Closed

Add wrapper structure to work on #66

wants to merge 19 commits into from

Conversation

rrtoledo
Copy link
Collaborator

@rrtoledo rrtoledo commented Nov 12, 2024

Content

Restructure the code to have a user facing structure from which we can directly prove and verify.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)

Comments

I removed the Params structure as it was not really needed and renamed the Setup one "Params".
I moved back the code into impls so that it is easier to use generics.

Issue(s)

Relates to #59

@rrtoledo rrtoledo added the enhancement New feature or request label Nov 12, 2024
@rrtoledo rrtoledo self-assigned this Nov 12, 2024
@rrtoledo rrtoledo marked this pull request as draft November 12, 2024 17:15
@rrtoledo rrtoledo marked this pull request as ready for review November 12, 2024 18:11
@rrtoledo rrtoledo linked an issue Nov 12, 2024 that may be closed by this pull request
4 tasks
@rrtoledo
Copy link
Collaborator Author

I used "telescope" as name for the wrapper structure, I am more than happy to change this.

@rrtoledo
Copy link
Collaborator Author

@djetchev @curiecrypt Are the comments for public functions reasonable? They could be more verbose perhaps?

@rrtoledo rrtoledo linked an issue Nov 12, 2024 that may be closed by this pull request
Copy link
Member

@tolikzinovyev tolikzinovyev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a big fan of the interface of Telescope::new(). This will just encourage the user to use user-friendly parameters instead of hardcoding Setup, which goes against https://github.com/cardano-scaling/alba/blob/8d8bcbfb130c58d57e7b6148c74737c35babc835/design/design.md#parameter-calculation.

I think new() should accept Setup only.

@rrtoledo
Copy link
Collaborator Author

rrtoledo commented Nov 13, 2024

I'm not a big fan of the interface of Telescope::new(). This will just encourage the user to use user-friendly parameters instead of hardcoding Setup, which goes against https://github.com/cardano-scaling/alba/blob/8d8bcbfb130c58d57e7b6148c74737c35babc835/design/design.md#parameter-calculation.

I think new() should accept Setup only.

And I strongly disagree with you as written in the PR of this document.

We should not make giving hardcoded parameters the norm, as we have no insurance they were computed correctly, this should also go against usable security principles and how cryptographic primitives are implemented generally.

@curiecrypt curiecrypt mentioned this pull request Nov 13, 2024
8 tasks
curiecrypt
curiecrypt previously approved these changes Nov 14, 2024
Copy link
Collaborator

@curiecrypt curiecrypt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK with this wrapper structure. It seems professional, user-friendly, and easy to read.
I just have 2 minor comments.
LGTM 👍

}

impl Params {
/// Setup algorithm taking as input the security parameters, the set size
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be a more detailed explanation in the documentation, for sure.
However, we might want to briefly mention why we have 3 different cases to compute the parameters in the function doc.

@@ -56,8 +58,9 @@ impl Round {
})
}

/// Oracle producing a uniformly random value in [0, set_size[ used for round candidates
/// We also return hash(data) to follow the optimization presented in Section 3.3
/// Oracle producing a uniformly random value in [0, set_size[ used for
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The characters [ and ] are special characters for cargo doc. They must be written in the form \[, \].
Also, is this intentional? [0, set_size [ ?
It would be good to test if there is anything complaining while compiling the cargo docs as well.

@curiecrypt
Copy link
Collaborator

I used "telescope" as name for the wrapper structure, I am more than happy to change this.

I tried to put another name but couldn't find a better one. We might think of a more creative one in the future.

@curiecrypt
Copy link
Collaborator

@djetchev @curiecrypt Are the comments for public functions reasonable? They could be more verbose perhaps?

I think most of the comments are quite descriptive. The structure seems pretty good. I suggested a minor improvement in my review.

I will put some links to the comments to direct the reader to the related documentation, FYI.

@curiecrypt
Copy link
Collaborator

I'm not a big fan of the interface of Telescope::new(). This will just encourage the user to use user-friendly parameters instead of hardcoding Setup, which goes against https://github.com/cardano-scaling/alba/blob/8d8bcbfb130c58d57e7b6148c74737c35babc835/design/design.md#parameter-calculation.
I think new() should accept Setup only.

And I strongly disagree with you as written in the PR of this document.

We should not make giving hardcoded parameters the norm, as we have no insurance they were computed correctly, this should also go against usable security principles and how cryptographic primitives are implemented generally.

I see the concerns of both of you @tolikzinovyev, @rrtoledo.
But, for the time being, I strongly believe that it is not the main concern. We should consider that the library will be used internally for the first stage and everything will be under control for a while.
So, my suggestion is to leave this kind of concerns to the future and try to obtain a working structure with the best way possible ASAP. We can add more labels such as future, security concern,... and open related issues with those tags. That might help us move faster without missing any important doubt.

@tolikzinovyev
Copy link
Member

I see your point @curiecrypt. More importantly, I think, we need to be coherent as a team. A design decision should first be discussed on the design document before there is a pull request that contradicts it. Otherwise, what is the point of the design document?

@rrtoledo rrtoledo mentioned this pull request Nov 7, 2024
4 tasks
tolikzinovyev added a commit that referenced this pull request Dec 5, 2024
## Content

A simple wrapper struct around `prove()` and `verify()` functions and
parameter derivation.

## Pre-submit checklist

- Branch
    - [x] Tests are provided (if possible)
    - [x] Commit sequence broadly makes sense
    - [x] Key commits have useful messages
- PR
    - [x] No clippy warnings in the CI
    - [x] Self-reviewed the diff
    - [x] Useful pull request description
    - [x] Reviewer requested
- Documentation
    - [x] Update README file (if relevant)
    - [x] Update documentation website (if relevant)

## Issue(s)

Relates to #66
curiecrypt added a commit that referenced this pull request Dec 9, 2024
## Content

This PR includes a new folder structure for centralized documentation.
Some example markdown files are created and they are linked to the
related source files.
The content will be filled out after the team approves the doc structure
and pr #66 and #73 are merged.

## Pre-submit checklist

- Branch
    - [x] Commit sequence broadly makes sense
    - [x] Key commits have useful messages
- PR
    - [x] No clippy warnings in the CI
    - [x] Self-reviewed the diff
    - [x] Useful pull request description
    - [x] Reviewer requested
- Documentation
    - [x] Update documentation website (if relevant)

## Issue(s)
Closes #88
@rrtoledo rrtoledo marked this pull request as draft December 13, 2024 18:23
@rrtoledo rrtoledo closed this Dec 24, 2024
@rrtoledo
Copy link
Collaborator Author

Replaced by #116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation for public functions Restruct code (2)
3 participants