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

[seraphis] seraphis_crypto: add crypto utils #9196

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

UkoeHB
Copy link
Contributor

@UkoeHB UkoeHB commented Feb 22, 2024

This is a PR in my 'upstreaming seraphis_lib project', the changes here are not used anywhere yet.

Adds a set of crypto utility functions. Some functions were taken from code written by Sarang:

  • invert(): bulletproofs2.cpp
  • decompose(): triptych experimental branch
  • kronecker_delta(): triptych experimental branch
  • convolve(): triptych experimental branch

These are security-critical functions.

{
return MINUS_ONE;
}
//-------------------------------------------------------------------------------------------------------------------

Choose a reason for hiding this comment

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

Where did you get the invert function from?
What are the requirements on the scalar so this operation works properly?
What would be the effect of inverting on clamped scalars?
Any comments on this phrase here?

In order to prevent attacks using small subgroups, the scalarmult functions above clear lower bits of the scalar. This may be indesirable to build protocols that requires n to be invertible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where did you get the invert function from?

As I said in the PR comment "Some functions were taken from code written by Sarang:" "invert(): bulletproofs2.cpp"

Copy link
Contributor

@jeffro256 jeffro256 left a comment

Choose a reason for hiding this comment

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

Quick comment about decompose()

src/seraphis_crypto/sp_crypto_utils.cpp Outdated Show resolved Hide resolved
Co-authored-by: Jeffro <jeffreyryan@tutanota.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants