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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add additional features to the "group" element type #2385

Closed
matthewdgreen opened this issue May 18, 2023 · 0 comments
Closed

[Feature] Add additional features to the "group" element type #2385

matthewdgreen opened this issue May 18, 2023 · 0 comments
Labels
feature A new feature.

Comments

@matthewdgreen
Copy link

馃殌 Feature

Currently in Leo (and SnarkVM) there is no way to implement the following three features on "group" elements:

  1. Obtaining the X-coordinate of an elliptic curve group element (as a field element)
  2. Hashing group elements through functions like Poseidon (this can be implemented using the feature above)
  3. Obtaining the generator point of the elliptic curve

Motivation

These three features are necessary to build Elgamal/ECIES (crypto_box) style encryption, which in a simplified version will look something like this.

Let "random_field" be a random field element. Let "generator_group" be the generator of the elliptic curve group. Let "message_field" be some message to encrypt. Let "PK_group" be the public key to encrypt to, as a group element.

C0 = random_field * generator_group,
C1 = Poseidon(random_field * PK_group) + message_field

Implementation

It seems likely that this will require additional opcodes in SnarkVM as well as a new command in Leo. Ideally this would be very simple:

  • g.x would provide the x coordinate of group element "g".
  • group.generator() might obtain the standard generator point (G) of the group.

Thank you!

@matthewdgreen matthewdgreen added the feature A new feature. label May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature.
Projects
None yet
Development

No branches or pull requests

1 participant